Changeset 254626 in webkit
- Timestamp:
- Jan 15, 2020 11:57:38 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r254558 r254626 1 2020-01-15 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Object.preventExtensions should throw if not successful 4 https://bugs.webkit.org/show_bug.cgi?id=206131 5 6 Reviewed by Ross Kirsling. 7 8 * test262/expectations.yaml: Mark 2 test cases as passing. 9 1 10 2020-01-14 Commit Queue <commit-queue@webkit.org> 2 11 -
trunk/JSTests/test262/expectations.yaml
r254390 r254626 1166 1166 default: 'Test262Error: Expected SameValue(«», «x») to be true' 1167 1167 strict mode: 'Test262Error: Expected SameValue(«», «x») to be true' 1168 test/built-ins/Object/preventExtensions/throws-when-false.js:1169 default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all'1170 strict mode: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all'1171 1168 test/built-ins/Object/proto-from-ctor-realm.js: 1172 1169 default: 'Test262Error: Expected SameValue(«[object Object]», «[object Object]») to be true' -
trunk/Source/JavaScriptCore/ChangeLog
r254625 r254626 1 2020-01-15 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Object.preventExtensions should throw if not successful 4 https://bugs.webkit.org/show_bug.cgi?id=206131 5 6 Reviewed by Ross Kirsling. 7 8 With this change, Object.preventExtensions throws TypeError if [[PreventExtensions]] 9 returns `false`. This is possible if Object.preventExtensions is called on a Proxy object. 10 (step 3 of https://tc39.es/ecma262/#sec-object.preventextensions) 11 12 * runtime/ObjectConstructor.cpp: 13 (JSC::objectConstructorPreventExtensions): 14 1 15 2020-01-15 Jonathan Bedard <jbedard@apple.com> 2 16 -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r252520 r254626 837 837 { 838 838 VM& vm = globalObject->vm(); 839 auto scope = DECLARE_THROW_SCOPE(vm); 840 839 841 JSValue argument = callFrame->argument(0); 840 842 if (!argument.isObject()) 841 843 return JSValue::encode(argument); 842 844 JSObject* object = asObject(argument); 843 object->methodTable(vm)->preventExtensions(object, globalObject); 845 bool status = object->methodTable(vm)->preventExtensions(object, globalObject); 846 RETURN_IF_EXCEPTION(scope, { }); 847 if (UNLIKELY(!status)) 848 return throwVMTypeError(globalObject, scope, "Unable to prevent extension in Object.preventExtensions"_s); 844 849 return JSValue::encode(object); 845 850 }
Note: See TracChangeset
for help on using the changeset viewer.