Changeset 252191 in webkit
- Timestamp:
- Nov 7, 2019 10:31:31 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r252160 r252191 1 2019-11-07 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 [[HasProperty]] result of Proxy in prototype chain is ignored 4 https://bugs.webkit.org/show_bug.cgi?id=203560 5 6 Reviewed by Ross Kirsling. 7 8 * stress/proxy-get-prototype-of.js: Correct Proxy "has" trap test. 9 * test262/expectations.yaml: Mark 6 test cases as passing. 10 1 11 2019-11-06 Mark Lam <mark.lam@apple.com> 2 12 -
trunk/JSTests/stress/proxy-get-prototype-of.js
r252158 r252191 390 390 let handler = { 391 391 getPrototypeOf: function(theTarget) { 392 assert(theTarget === target);393 392 called = true; 394 393 return proto; … … 401 400 let proxy = new Proxy(target, handler); 402 401 for (let i = 0; i < 500; i++) { 403 let result = "x" in proxy; 404 assert(called); 405 called = false; 402 let result = 1 in proxy; 403 assert(!called); 406 404 } 407 405 } -
trunk/JSTests/test262/expectations.yaml
r252158 r252191 634 634 default: 'TypeError: Attempted to assign to readonly property.' 635 635 strict mode: 'TypeError: Attempted to assign to readonly property.' 636 test/built-ins/Array/prototype/indexOf/calls-only-has-on-prototype-after-length-zeroed.js:637 default: 'Test262Error: [[GetPrototypeOf]] trap called'638 strict mode: 'Test262Error: [[GetPrototypeOf]] trap called'639 test/built-ins/Array/prototype/lastIndexOf/calls-only-has-on-prototype-after-length-zeroed.js:640 default: 'Test262Error: [[GetPrototypeOf]] trap called'641 strict mode: 'Test262Error: [[GetPrototypeOf]] trap called'642 636 test/built-ins/Array/prototype/map/target-array-with-non-writable-property.js: 643 637 default: 'TypeError: Attempted to assign to readonly property.' … … 665 659 strict mode: 'Test262Error: Length is 2**53 - 1 Expected a TypeError to be thrown but no exception was thrown at all' 666 660 test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-proxy.js: 667 default: 'Test262Error: Expected a StopReverse but got a Test262Error'668 strict mode: 'Test262Error: Expected a StopReverse but got a Test262Error'661 default: 'Test262Error: Expected [Get:length, Has:0, Get:0, Has:4294967294, Delete:0, Set:4294967294, GetOwnPropertyDescriptor:4294967294, DefineProperty:4294967294, Has:1, Has:4294967293, Delete:1, Delete:4294967293, Has:2, Get:2, Has:4294967292, Delete:2, Set:4294967292, GetOwnPropertyDescriptor:4294967292, DefineProperty:4294967292, Has:3, Has:4294967291, Delete:3, Delete:4294967291, Has:4, Get:4] and [Get:length, Has:0, Get:0, Has:9007199254740990, Get:9007199254740990, Set:0, GetOwnPropertyDescriptor:0, DefineProperty:0, Set:9007199254740990, GetOwnPropertyDescriptor:9007199254740990, DefineProperty:9007199254740990, Has:1, Has:9007199254740989, Has:2, Get:2, Has:9007199254740988, Delete:2, Set:9007199254740988, GetOwnPropertyDescriptor:9007199254740988, DefineProperty:9007199254740988, Has:3, Has:9007199254740987, Get:9007199254740987, Set:3, GetOwnPropertyDescriptor:3, DefineProperty:3, Delete:9007199254740987, Has:4, Get:4] to have the same contents. ' 662 strict mode: 'Test262Error: Expected [Get:length, Has:0, Get:0, Has:4294967294, Delete:0, Set:4294967294, GetOwnPropertyDescriptor:4294967294, DefineProperty:4294967294, Has:1, Has:4294967293, Delete:1, Delete:4294967293, Has:2, Get:2, Has:4294967292, Delete:2, Set:4294967292, GetOwnPropertyDescriptor:4294967292, DefineProperty:4294967292, Has:3, Has:4294967291, Delete:3, Delete:4294967291, Has:4, Get:4] and [Get:length, Has:0, Get:0, Has:9007199254740990, Get:9007199254740990, Set:0, GetOwnPropertyDescriptor:0, DefineProperty:0, Set:9007199254740990, GetOwnPropertyDescriptor:9007199254740990, DefineProperty:9007199254740990, Has:1, Has:9007199254740989, Has:2, Get:2, Has:9007199254740988, Delete:2, Set:9007199254740988, GetOwnPropertyDescriptor:9007199254740988, DefineProperty:9007199254740988, Has:3, Has:9007199254740987, Get:9007199254740987, Set:3, GetOwnPropertyDescriptor:3, DefineProperty:3, Delete:9007199254740987, Has:4, Get:4] to have the same contents. ' 669 663 test/built-ins/Array/prototype/slice/length-exceeding-integer-limit-proxied-array.js: 670 664 default: 'Test262Error: Expected [] and [9007199254740989, 9007199254740990] to have the same contents. slice(9007199254740989)' … … 686 680 strict mode: 'TypeError: Attempted to assign to readonly property.' 687 681 test/built-ins/Array/prototype/splice/create-species-length-exceeding-integer-limit.js: 688 default: 'Test262Error: Expected a StopSplice but got a Test262Error'689 strict mode: 'Test262Error: Expected a StopSplice but got a Test262Error'682 default: 'Test262Error: length and deleteCount were correctly clamped to 2^53-1 Expected SameValue(«4294967295», «9007199254740991») to be true' 683 strict mode: 'Test262Error: length and deleteCount were correctly clamped to 2^53-1 Expected SameValue(«4294967295», «9007199254740991») to be true' 690 684 test/built-ins/Array/prototype/splice/length-and-deleteCount-exceeding-integer-limit.js: 691 685 default: "Test262Error: Expected [] and [9007199254740989, 9007199254740990] to have the same contents. arrayLike['9007199254740989'] and arrayLike['9007199254740990'] are removed" … … 1154 1148 default: 'Test262Error: Expected a TypeError but got a TypeError' 1155 1149 strict mode: 'Test262Error: Expected a TypeError but got a TypeError' 1156 test/built-ins/Proxy/has/call-in-prototype.js:1157 default: 'Test262Error: [[GetPrototypeOf]] trap called'1158 strict mode: 'Test262Error: [[GetPrototypeOf]] trap called'1159 1150 test/built-ins/Proxy/revocable/revocation-function-name.js: 1160 1151 default: 'Test262Error: obj should have an own property name' -
trunk/Source/JavaScriptCore/ChangeLog
r252177 r252191 1 2019-11-07 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 [[HasProperty]] result of Proxy in prototype chain is ignored 4 https://bugs.webkit.org/show_bug.cgi?id=203560 5 6 Reviewed by Ross Kirsling. 7 8 Before this change, when [[HasProperty]] was called on ordinary object with Proxy in prototype chain, 9 falsy result of Proxy's "has" trap was ignored and prototype chain was inspected further. 10 11 According to spec, OrdinaryHasProperty unconditionally returns result of parent's [[HasProperty]] call. 12 (step 5.a of https://tc39.es/ecma262/#sec-ordinaryhasproperty) 13 14 * runtime/JSObjectInlines.h: 15 (JSC::JSObject::getPropertySlot): 16 (JSC::JSObject::getNonIndexPropertySlot): 17 * runtime/ProxyObject.cpp: 18 (JSC::ProxyObject::performHasProperty): Walk the prototype chain in performDefaultHasProperty. 19 1 20 2019-11-06 Mark Lam <mark.lam@apple.com> 2 21 -
trunk/Source/JavaScriptCore/runtime/JSObjectInlines.h
r252158 r252191 127 127 if (hasSlot) 128 128 return true; 129 if (object->type() == ProxyObjectType && slot.internalMethodType() == PropertySlot::InternalMethodType::HasProperty) 130 return false; 129 131 JSValue prototype; 130 132 if (LIKELY(structure->classInfo()->methodTable.getPrototype == defaultGetPrototype || slot.internalMethodType() == PropertySlot::InternalMethodType::VMInquiry)) … … 160 162 if (hasSlot) 161 163 return true; 164 if (object->type() == ProxyObjectType && slot.internalMethodType() == PropertySlot::InternalMethodType::HasProperty) 165 return false; 162 166 } 163 167 JSValue prototype; -
trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp
r251425 r252191 323 323 324 324 auto performDefaultHasProperty = [&] { 325 return target-> methodTable(vm)->getOwnPropertySlot(target,globalObject, propertyName, slot);325 return target->getPropertySlot(globalObject, propertyName, slot); 326 326 }; 327 327
Note: See TracChangeset
for help on using the changeset viewer.