Changeset 254757 in webkit
- Timestamp:
- Jan 17, 2020 12:21:57 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r254738 r254757 1 2020-01-17 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 JSON.parse should lookup prototype chains during revival 4 https://bugs.webkit.org/show_bug.cgi?id=205769 5 6 Reviewed by Saam Barati. 7 8 * test262/expectations.yaml: Mark 4 test cases as passing. 9 1 10 2020-01-16 Robin Morisset <rmorisset@apple.com> 2 11 -
trunk/JSTests/test262/expectations.yaml
r254626 r254757 1120 1120 default: 'Test262Error: Expected SameValue(«[object GeneratorFunction]», «[object GeneratorFunction]») to be true' 1121 1121 strict mode: 'Test262Error: Expected SameValue(«[object GeneratorFunction]», «[object GeneratorFunction]») to be true' 1122 test/built-ins/JSON/parse/reviver-array-get-prop-from-prototype.js:1123 default: 'Test262Error: Expected true but got false'1124 strict mode: 'Test262Error: Expected true but got false'1125 1122 test/built-ins/JSON/parse/reviver-array-non-configurable-prop-create.js: 1126 1123 default: 'Test262Error: Expected SameValue(«22», «2») to be true' 1127 1124 strict mode: 'Test262Error: Expected SameValue(«22», «2») to be true' 1128 test/built-ins/JSON/parse/reviver-object-get-prop-from-prototype.js:1129 default: 'Test262Error: Expected true but got false'1130 strict mode: 'Test262Error: Expected true but got false'1131 1125 test/built-ins/JSON/parse/reviver-object-non-configurable-prop-create.js: 1132 1126 default: 'Test262Error: Expected SameValue(«22», «2») to be true' -
trunk/Source/JavaScriptCore/ChangeLog
r254748 r254757 1 2020-01-17 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 JSON.parse should lookup prototype chains during revival 4 https://bugs.webkit.org/show_bug.cgi?id=205769 5 6 Reviewed by Saam Barati. 7 8 This patch makes JSON.parse use [[Get]] instead of [[GetOwnProperty]] during revival, 9 aligning JSC with the spec (step 1 of https://tc39.es/ecma262/#sec-internalizejsonproperty), 10 SpiderMonkey, and V8. 11 12 User-provided `reviver` can delete properties that are not yet inspected by itself, 13 making usage [[GetOwnProperty]] non-compliant to the spec. 14 15 * runtime/JSONObject.cpp: 16 (JSC::Walker::walk): 17 1 18 2020-01-17 Caio Lima <ticaiolima@gmail.com> 2 19 -
trunk/Source/JavaScriptCore/runtime/JSONObject.cpp
r254037 r254757 693 693 inValue = array->getIndexQuickly(index); 694 694 else { 695 PropertySlot slot(array, PropertySlot::InternalMethodType::Get); 696 if (array->methodTable(vm)->getOwnPropertySlotByIndex(array, m_globalObject, index, slot)) 697 inValue = slot.getValue(m_globalObject, index); 698 else 699 inValue = jsUndefined(); 695 inValue = array->get(m_globalObject, index); 700 696 RETURN_IF_EXCEPTION(scope, { }); 701 697 } 702 698 703 699 if (inValue.isObject()) { 704 700 stateStack.append(ArrayEndVisitMember); … … 747 743 break; 748 744 } 749 PropertySlot slot(object, PropertySlot::InternalMethodType::Get); 750 if (object->methodTable(vm)->getOwnPropertySlot(object, m_globalObject, properties[index], slot)) 751 inValue = slot.getValue(m_globalObject, properties[index]); 752 else 753 inValue = jsUndefined(); 754 745 inValue = object->get(m_globalObject, properties[index]); 755 746 // The holder may be modified by the reviver function so any lookup may throw 756 747 RETURN_IF_EXCEPTION(scope, { });
Note: See TracChangeset
for help on using the changeset viewer.