Changeset 199712 in webkit for trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
- Timestamp:
- Apr 19, 2016, 1:47:44 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r199699 r199712 759 759 generator.emitMove(callArguments.thisRegister(), generator.newTarget()); 760 760 RegisterID* ret = generator.emitConstruct(returnValue.get(), func.get(), NoExpectedFunction, callArguments, divot(), divotStart(), divotEnd()); 761 762 bool isConstructorKindDerived = generator.constructorKind() == ConstructorKind::Derived; 763 bool doWeUseArrowFunctionInConstructor = isConstructorKindDerived && generator.needsToUpdateArrowFunctionContext(); 764 765 if (generator.isDerivedConstructorContext() || (doWeUseArrowFunctionInConstructor && generator.isSuperCallUsedInInnerArrowFunction())) 766 generator.emitLoadThisFromArrowFunctionLexicalEnvironment(); 767 768 RefPtr<Label> thisIsEmptyLabel = generator.newLabel(); 769 generator.emitJumpIfTrue(generator.emitIsEmpty(generator.newTemporary(), generator.thisRegister()), thisIsEmptyLabel.get()); 770 generator.emitThrowReferenceError(ASCIILiteral("'super()' can't be called more than once in a constructor.")); 771 generator.emitLabel(thisIsEmptyLabel.get()); 772 761 773 generator.emitMove(generator.thisRegister(), ret); 762 774 763 bool isConstructorKindDerived = generator.constructorKind() == ConstructorKind::Derived; 764 if (generator.isDerivedConstructorContext() || (isConstructorKindDerived && generator.needsToUpdateArrowFunctionContext())) 775 if (generator.isDerivedConstructorContext() || doWeUseArrowFunctionInConstructor) 765 776 generator.emitPutThisToArrowFunctionContextScope(); 766 777
Note:
See TracChangeset
for help on using the changeset viewer.