Changeset 202796 in webkit
- Timestamp:
- Jul 3, 2016 8:25:04 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202794 r202796 1 2016-07-03 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] __lookupGetter__ and __lookupSetter__ should not ignore exceptions 4 https://bugs.webkit.org/show_bug.cgi?id=159390 5 6 Reviewed by Mark Lam. 7 8 * js/property-getters-and-setters-expected.txt: 9 * js/script-tests/property-getters-and-setters.js: 10 (getter17): 11 (get getter17): 12 (getOwnPropertyDescriptor): 13 (setter18): 14 (set setter18): 15 1 16 2016-07-03 Frederic Wang <fred.wang@free.fr> 2 17 -
trunk/LayoutTests/js/property-getters-and-setters-expected.txt
r202755 r202796 59 59 PASS o16.__defineSetter__('b', function(){}) threw exception TypeError: Attempting to change configurable attribute of unconfigurable property.. 60 60 PASS o16.__defineSetter__('b', function(){}) threw exception TypeError: Attempting to change configurable attribute of unconfigurable property.. 61 __lookupGetter__ can be interrupted by a proxy throwing an exception 62 PASS o17.property is "WebKit!" 63 PASS o17.__lookupGetter__('property') is getter17 64 PASS o17.__lookupSetter__('property') is undefined 65 PASS o17Proxy.__lookupGetter__('property') threw exception o17 Proxy raised exception. 66 PASS o17Proxy.__lookupSetter__('property') threw exception o17 Proxy raised exception. 67 PASS o17Proxy.property is "WebKit!" 68 PASS o17.property is "WebKit!" 69 PASS o17.__lookupGetter__('property') is getter17 70 __lookupSetter__ can be interrupted by a proxy throwing an exception 71 PASS o18.property = 5 is 5 72 PASS o18.property is undefined 73 PASS o18.value is 5 74 PASS o18.__lookupGetter__('property') is undefined 75 PASS o18.__lookupSetter__('property') is setter18 76 PASS o18Proxy.__lookupGetter__('property') threw exception o18 Proxy raised exception. 77 PASS o18Proxy.__lookupSetter__('property') threw exception o18 Proxy raised exception. 78 PASS o18Proxy.property = 'JavaScriptCore!' threw exception o18 Proxy raised exception. 79 PASS o18Proxy.property is undefined 80 PASS o18Proxy.value is 5 81 PASS o18.property = 'JavaScriptCore!' is "JavaScriptCore!" 82 PASS o18.property is undefined 83 PASS o18.value is "JavaScriptCore!" 84 PASS o18.__lookupGetter__('property') is undefined 85 PASS o18.__lookupSetter__('property') is setter18 61 86 PASS successfullyParsed is true 62 87 -
trunk/LayoutTests/js/script-tests/property-getters-and-setters.js
r202755 r202796 124 124 shouldThrow("o16.__defineSetter__('b', function(){})"); 125 125 shouldThrow("o16.__defineSetter__('b', function(){})"); 126 127 debug("__lookupGetter__ can be interrupted by a proxy throwing an exception"); 128 var getter17 = () => { return "WebKit!"} 129 var o17 = Object.defineProperty(new Object, 'property', { get: getter17 }); 130 shouldBeEqualToString("o17.property", "WebKit!"); 131 shouldBe("o17.__lookupGetter__('property')", "getter17"); 132 shouldBe("o17.__lookupSetter__('property')", "undefined"); 133 134 var o17Exception = { toString: () => { return "o17 Proxy raised exception"; } }; 135 var o17Proxy = new Proxy(o17, { getOwnPropertyDescriptor: () => { throw o17Exception; } }); 136 shouldThrow("o17Proxy.__lookupGetter__('property')", o17Exception); 137 shouldThrow("o17Proxy.__lookupSetter__('property')", o17Exception); 138 shouldBeEqualToString("o17Proxy.property", "WebKit!"); 139 shouldBeEqualToString("o17.property", "WebKit!"); 140 shouldBe("o17.__lookupGetter__('property')", "getter17"); 141 142 debug("__lookupSetter__ can be interrupted by a proxy throwing an exception"); 143 var setter18 = function (newValue) { return this.value = newValue; } 144 var o18 = Object.defineProperty(new Object, 'property', { set: setter18 }); 145 shouldBe("o18.property = 5", "5"); 146 shouldBe("o18.property", "undefined"); 147 shouldBe("o18.value", "5"); 148 shouldBe("o18.__lookupGetter__('property')", "undefined"); 149 shouldBe("o18.__lookupSetter__('property')", "setter18"); 150 151 var o18Exception = { toString: () => { return "o18 Proxy raised exception"; } }; 152 var o18Proxy = new Proxy(o18, { getOwnPropertyDescriptor: () => { throw o18Exception; } }); 153 shouldThrow("o18Proxy.__lookupGetter__('property')", o18Exception); 154 shouldThrow("o18Proxy.__lookupSetter__('property')", o18Exception); 155 shouldThrow("o18Proxy.property = 'JavaScriptCore!'", o18Exception); 156 shouldBe("o18Proxy.property", "undefined"); 157 shouldBe("o18Proxy.value", "5"); 158 shouldBeEqualToString("o18.property = 'JavaScriptCore!'", "JavaScriptCore!"); 159 shouldBe("o18.property", "undefined"); 160 shouldBeEqualToString("o18.value", "JavaScriptCore!"); 161 shouldBe("o18.__lookupGetter__('property')", "undefined"); 162 shouldBe("o18.__lookupSetter__('property')", "setter18"); -
trunk/Source/JavaScriptCore/ChangeLog
r202795 r202796 1 2016-07-03 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] __lookupGetter__ and __lookupSetter__ should not ignore exceptions 4 https://bugs.webkit.org/show_bug.cgi?id=159390 5 6 Reviewed by Mark Lam. 7 8 See: 9 -https://tc39.github.io/ecma262/#sec-object.prototype.__lookupGetter__ 10 -https://tc39.github.io/ecma262/#sec-object.prototype.__lookupSetter__ 11 12 They are both supposed to be regular [[GetOwnProperty]]. 13 14 * runtime/ObjectPrototype.cpp: 15 (JSC::objectProtoFuncLookupGetter): 16 (JSC::objectProtoFuncLookupSetter): 17 1 18 2016-07-03 Saam Barati <sbarati@apple.com> 2 19 -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
r202755 r202796 188 188 return JSValue::encode(jsUndefined()); 189 189 190 PropertySlot slot(thisObject, PropertySlot::InternalMethodType:: VMInquiry);190 PropertySlot slot(thisObject, PropertySlot::InternalMethodType::GetOwnProperty); 191 191 if (thisObject->getPropertySlot(exec, propertyName, slot)) { 192 192 if (slot.isAccessor()) { … … 215 215 return JSValue::encode(jsUndefined()); 216 216 217 PropertySlot slot(thisObject, PropertySlot::InternalMethodType:: VMInquiry);217 PropertySlot slot(thisObject, PropertySlot::InternalMethodType::GetOwnProperty); 218 218 if (thisObject->getPropertySlot(exec, propertyName, slot)) { 219 219 if (slot.isAccessor()) {
Note: See TracChangeset
for help on using the changeset viewer.