Changeset 247471 in webkit
- Timestamp:
- Jul 15, 2019 9:26:06 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r247469 r247471 1 2019-07-15 Keith Miller <keith_miller@apple.com> 2 3 A Possible Issue of Object.create method 4 https://bugs.webkit.org/show_bug.cgi?id=199744 5 6 Reviewed by Yusuke Suzuki. 7 8 * stress/object-create-non-object-properties-parameter.js: Added. 9 (catch): 10 1 11 2019-07-15 Keith Miller <keith_miller@apple.com> 2 12 -
trunk/LayoutTests/ChangeLog
r247468 r247471 1 2019-07-15 Keith Miller <keith_miller@apple.com> 2 3 A Possible Issue of Object.create method 4 https://bugs.webkit.org/show_bug.cgi?id=199744 5 6 Reviewed by Yusuke Suzuki. 7 8 Rebaseline error message due to change of error point. 9 10 * js/Object-create-expected.txt: 11 1 12 2019-07-15 Saam Barati <sbarati@apple.com> 2 13 -
trunk/LayoutTests/js/Object-create-expected.txt
r51760 r247471 6 6 PASS Object.create() threw exception TypeError: Object prototype may only be an Object or null.. 7 7 PASS Object.create('a string') threw exception TypeError: Object prototype may only be an Object or null.. 8 PASS Object.create({}, 'a string') threw exception TypeError: Property descript or list must be an Object..9 PASS Object.create(null, 'a string') threw exception TypeError: Property descript or list must be an Object..8 PASS Object.create({}, 'a string') threw exception TypeError: Property description must be an object.. 9 PASS Object.create(null, 'a string') threw exception TypeError: Property description must be an object.. 10 10 PASS JSON.stringify(Object.create(null,{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}})) is '{"property":"foo","property2":"foo"}' 11 11 PASS JSON.stringify(Object.create({},{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}})) is '{"property":"foo","property2":"foo"}' -
trunk/Source/JavaScriptCore/ChangeLog
r247463 r247471 1 2019-07-15 Keith Miller <keith_miller@apple.com> 2 3 A Possible Issue of Object.create method 4 https://bugs.webkit.org/show_bug.cgi?id=199744 5 6 Reviewed by Yusuke Suzuki. 7 8 We should call toObject on the properties argument if it was not undefined. 9 See: https://tc39.es/ecma262/#sec-object.create 10 11 * runtime/ObjectConstructor.cpp: 12 (JSC::objectConstructorCreate): 13 1 14 2019-07-15 Saagar Jha <saagarjha@apple.com> 2 15 -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r244330 r247471 670 670 if (exec->argument(1).isUndefined()) 671 671 return JSValue::encode(newObject); 672 if (!exec->argument(1).isObject()) 673 return throwVMTypeError(exec, scope, "Property descriptor list must be an Object."_s); 674 RELEASE_AND_RETURN(scope, JSValue::encode(defineProperties(exec, newObject, asObject(exec->argument(1))))); 672 JSObject* properties = exec->uncheckedArgument(1).toObject(exec); 673 RETURN_IF_EXCEPTION(scope, { }); 674 675 RELEASE_AND_RETURN(scope, JSValue::encode(defineProperties(exec, newObject, properties))); 675 676 } 676 677
Note: See TracChangeset
for help on using the changeset viewer.