Changeset 202664 in webkit
- Timestamp:
- Jun 29, 2016 8:55:34 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r202659 r202664 1 2016-06-29 Saam barati <sbarati@apple.com> 2 3 JSGlobalLexicalEnvironment needs a toThis implementation 4 https://bugs.webkit.org/show_bug.cgi?id=159285 5 6 Reviewed by Mark Lam. 7 8 This was a huge oversight of my original implementation. It gave users 9 of the language direct access to the JSGlobalLexicalEnvironment object. 10 11 * runtime/JSGlobalLexicalEnvironment.cpp: 12 (JSC::JSGlobalLexicalEnvironment::isConstVariable): 13 (JSC::JSGlobalLexicalEnvironment::toThis): 14 * runtime/JSGlobalLexicalEnvironment.h: 15 (JSC::JSGlobalLexicalEnvironment::isEmpty): 16 * tests/stress/global-lexical-environment-to-this.js: Added. 17 (assert): 18 (let.f): 19 (let.fStrict): 20 1 21 2016-06-29 Joseph Pecoraro <pecoraro@apple.com> 2 22 -
trunk/Source/JavaScriptCore/runtime/JSGlobalLexicalEnvironment.cpp
r201494 r202664 62 62 } 63 63 64 JSValue JSGlobalLexicalEnvironment::toThis(JSCell*, ExecState* exec, ECMAMode ecmaMode) 65 { 66 if (ecmaMode == StrictMode) 67 return jsUndefined(); 68 return exec->globalThisValue(); 69 } 70 64 71 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSGlobalLexicalEnvironment.h
r201494 r202664 36 36 typedef JSSegmentedVariableObject Base; 37 37 38 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot ;38 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesToThis; 39 39 40 40 static JSGlobalLexicalEnvironment* create(VM& vm, Structure* structure, JSScope* parentScope) … … 57 57 bool isEmpty() const { return !symbolTable()->size(); } 58 58 bool isConstVariable(UniquedStringImpl*); 59 60 static JSValue toThis(JSCell*, ExecState*, ECMAMode); 59 61 60 62 DECLARE_INFO;
Note: See TracChangeset
for help on using the changeset viewer.