Skip to content

Commit

Permalink
Bug 1521696 - Fix PropertyEmitter not to use JSOP_OBJECT when the obj…
Browse files Browse the repository at this point in the history
…est has accessor. r=jorendorff

Differential Revision: https://phabricator.services.mozilla.com/D17471

--HG--
extra : moz-landing-system : lando
  • Loading branch information
arai-a committed Jan 29, 2019
1 parent e95014d commit 87f97d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/src/frontend/ObjectEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,13 @@ bool PropertyEmitter::emitInitProp(
}

bool PropertyEmitter::emitInitGetter(JS::Handle<JSAtom*> key) {
obj_ = nullptr;
return emitInit(isClass_ ? JSOP_INITHIDDENPROP_GETTER : JSOP_INITPROP_GETTER,
key, false, nullptr);
}

bool PropertyEmitter::emitInitSetter(JS::Handle<JSAtom*> key) {
obj_ = nullptr;
return emitInit(isClass_ ? JSOP_INITHIDDENPROP_SETTER : JSOP_INITPROP_SETTER,
key, false, nullptr);
}
Expand All @@ -310,12 +312,14 @@ bool PropertyEmitter::emitInitIndexProp(
}

bool PropertyEmitter::emitInitIndexGetter() {
obj_ = nullptr;
return emitInitIndexOrComputed(
isClass_ ? JSOP_INITHIDDENELEM_GETTER : JSOP_INITELEM_GETTER,
FunctionPrefixKind::Get, false);
}

bool PropertyEmitter::emitInitIndexSetter() {
obj_ = nullptr;
return emitInitIndexOrComputed(
isClass_ ? JSOP_INITHIDDENELEM_SETTER : JSOP_INITELEM_SETTER,
FunctionPrefixKind::Set, false);
Expand All @@ -329,12 +333,14 @@ bool PropertyEmitter::emitInitComputedProp(
}

bool PropertyEmitter::emitInitComputedGetter() {
obj_ = nullptr;
return emitInitIndexOrComputed(
isClass_ ? JSOP_INITHIDDENELEM_GETTER : JSOP_INITELEM_GETTER,
FunctionPrefixKind::Get, true);
}

bool PropertyEmitter::emitInitComputedSetter() {
obj_ = nullptr;
return emitInitIndexOrComputed(
isClass_ ? JSOP_INITHIDDENELEM_SETTER : JSOP_INITELEM_SETTER,
FunctionPrefixKind::Set, true);
Expand Down

0 comments on commit 87f97d4

Please sign in to comment.