Skip to content

Commit

Permalink
fix GetNextPName
Browse files Browse the repository at this point in the history
Summary: .

Reviewed By: avp

Differential Revision: D15750547

fbshipit-source-id: 25ace335f1f9489af7a402bcd1935babed992cfd
  • Loading branch information
tmikov authored and facebook-github-bot committed Jan 15, 2020
1 parent e8ede1d commit f7b1791
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/VM/JIT/ExternalCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,17 +761,18 @@ HermesValue externGetNextPName(
PinnedHermesValue *sizeReg) {
GCScopeMarkerRAII marker{runtime};

assert(vmisa<JSArray>(*arrReg) && "GetNextPName's second op must be JSArray");
assert(
vmisa<BigStorage>(*arrReg) && "GetNextPName's second op must be JSArray");
auto obj = Handle<JSObject>::vmcast(objReg);
auto arr = Handle<JSArray>::vmcast(arrReg);
auto arr = Handle<BigStorage>::vmcast(arrReg);
uint32_t idx = iterReg->getNumber();
uint32_t size = sizeReg->getNumber();
PinnedHermesValue *scratch = &runtime->getCurrentFrame().getScratchRef();
MutableHandle<JSObject> propObj{runtime};

// Loop until we find a property which is present.
while (idx < size) {
*scratch = arr->at(runtime, idx);
*scratch = arr->at(idx);
ComputedPropertyDescriptor desc;
JSObject::getComputedPrimitiveDescriptor(
obj, runtime, Handle<>(scratch), propObj, desc);
Expand Down

0 comments on commit f7b1791

Please sign in to comment.