Changeset 90402 in webkit
- Timestamp:
- Jul 5, 2011 12:02:44 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r90401 r90402 1 2011-07-05 Gavin Barraclough <barraclough@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=63947 4 ASSERT running Object.preventExtensions(Math.sin) 5 6 Reviewed by Oliver Hunt. 7 8 This is due to calling scope() on a hostFunction as a part of 9 calling createPrototypeProperty to reify the prototype property. 10 But host functions don't have a prototype property anyway! 11 12 Add test case for calling preventExtensions on a host function. 13 14 * fast/js/preventExtensions-expected.txt: 15 * fast/js/script-tests/preventExtensions.js: 16 1 17 2011-07-04 Gavin Barraclough <barraclough@apple.com> 2 18 -
trunk/LayoutTests/fast/js/preventExtensions-expected.txt
r87826 r90402 11 11 PASS test(seal(obj())) is "(a:1)(b:4)S" 12 12 PASS test(freeze(obj())) is "(a:1)(b:2)SF" 13 PASS Object.preventExtensions(Math.sin) is Math.sin 13 14 PASS successfullyParsed is true 14 15 -
trunk/LayoutTests/fast/js/script-tests/preventExtensions.js
r87826 r90402 66 66 shouldBe('test(freeze(obj()))', '"(a:1)(b:2)SF"'); // sealed and frozen, CANNOT delete a, CANNOT modify b, and CANNOT add c 67 67 68 // check that we can preventExtensions on a host function. 69 shouldBe('Object.preventExtensions(Math.sin)', 'Math.sin'); 70 68 71 successfullyParsed = true; -
trunk/Source/JavaScriptCore/ChangeLog
r90401 r90402 1 2011-07-05 Gavin Barraclough <barraclough@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=63947 4 ASSERT running Object.preventExtensions(Math.sin) 5 6 Reviewed by Oliver Hunt. 7 8 This is due to calling scope() on a hostFunction as a part of 9 calling createPrototypeProperty to reify the prototype property. 10 But host functions don't have a prototype property anyway! 11 12 Prevent callling createPrototypeProperty on a host function. 13 14 * runtime/JSFunction.cpp: 15 (JSC::JSFunction::createPrototypeProperty): 16 (JSC::JSFunction::preventExtensions): 17 1 18 2011-07-04 Gavin Barraclough <barraclough@apple.com> 2 19 -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r88315 r90402 180 180 static inline WriteBarrierBase<Unknown>* createPrototypeProperty(JSGlobalData& globalData, JSGlobalObject* globalObject, JSFunction* function) 181 181 { 182 ASSERT(!isHostFunction()); 183 182 184 ExecState* exec = globalObject->globalExec(); 183 185 if (WriteBarrierBase<Unknown>* location = function->getDirectLocation(globalData, exec->propertyNames().prototype)) … … 191 193 void JSFunction::preventExtensions(JSGlobalData& globalData) 192 194 { 193 createPrototypeProperty(globalData, scope()->globalObject.get(), this); 195 if (!isHostFunction()) 196 createPrototypeProperty(globalData, scope()->globalObject.get(), this); 194 197 JSObject::preventExtensions(globalData); 195 198 }
Note: See TracChangeset
for help on using the changeset viewer.