Changeset 196361 in webkit
- Timestamp:
- Feb 9, 2016 10:01:28 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r196337 r196361 1 2016-02-09 Keith Miller <keith_miller@apple.com> 2 3 calling methods off super in a class constructor should check for TDZ 4 https://bugs.webkit.org/show_bug.cgi?id=154060 5 6 Reviewed by Ryosuke Niwa. 7 8 In a class constructor we need to check for TDZ when calling a method 9 off the super class. This is because, for super method calls, we use 10 the derived class's newly constructed object as the super method's 11 this value. 12 13 * bytecompiler/NodesCodegen.cpp: 14 (JSC::FunctionCallDotNode::emitBytecode): 15 * tests/stress/super-method-calls-check-tdz.js: Added. 16 (Base): 17 (Derived): 18 (test): 19 1 20 2016-02-09 Filip Pizlo <fpizlo@apple.com> 2 21 -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r196323 r196361 919 919 CallArguments callArguments(generator, m_args); 920 920 bool baseIsSuper = m_base->isSuperNode(); 921 if (baseIsSuper) 921 if (baseIsSuper) { 922 generator.emitTDZCheck(generator.thisRegister()); 922 923 generator.emitMove(callArguments.thisRegister(), generator.thisRegister()); 923 else924 } else 924 925 generator.emitNode(callArguments.thisRegister(), m_base); 925 926 generator.emitExpressionInfo(subexpressionDivot(), subexpressionStart(), subexpressionEnd());
Note: See TracChangeset
for help on using the changeset viewer.