WebKit Bugzilla
Attachment 371890 Details for
Bug 154376
: [ES6] Come up with a test for Proxy.[[GetOwnProperty]] that tests the isExtensible error when the result of the trap is undefined
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-154376-20190612021139.patch (text/plain), 3.67 KB, created by
Alexey Shvayka
on 2019-06-11 16:11:41 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alexey Shvayka
Created:
2019-06-11 16:11:41 PDT
Size:
3.67 KB
patch
obsolete
>Index: JSTests/ChangeLog >=================================================================== >--- JSTests/ChangeLog (revision 246338) >+++ JSTests/ChangeLog (working copy) >@@ -1,3 +1,12 @@ >+2019-06-11 Alexey Shvayka <shvaikalesh@gmail.com> >+ >+ [ES6] Come up with a test for Proxy.[[GetOwnProperty]] that tests the isExtensible error when the result of the trap is undefined >+ https://bugs.webkit.org/show_bug.cgi?id=154376 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * stress/proxy-get-own-property.js: Add test case. >+ > 2019-06-11 Alexey Shvayka <shvaikalesh@gmail.com> > > Error message for non-callable Proxy `construct` trap is misleading >Index: JSTests/stress/proxy-get-own-property.js >=================================================================== >--- JSTests/stress/proxy-get-own-property.js (revision 246067) >+++ JSTests/stress/proxy-get-own-property.js (working copy) >@@ -69,6 +69,28 @@ function assert(b) { > } > > { >+ let target = Object.preventExtensions({x: 1}); >+ let handler = { >+ getOwnPropertyDescriptor: function(theTarget, propName) { >+ assert(theTarget === target); >+ assert(propName === "x"); >+ return undefined; >+ } >+ }; >+ let proxy = new Proxy(target, handler); >+ for (let i = 0; i < 500; i++) { >+ let threw = false; >+ try { >+ Object.getOwnPropertyDescriptor(proxy, "x"); >+ } catch(e) { >+ assert(e.toString() === "TypeError: When 'getOwnPropertyDescriptor' returns undefined, the 'target' of a Proxy should be extensible"); >+ threw = true; >+ } >+ assert(threw); >+ } >+} >+ >+{ > let target = {}; > Object.defineProperty(target, "x", { > enumerable: true, >Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 246302) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2019-06-11 Alexey Shvayka <shvaikalesh@gmail.com> >+ >+ [ES6] Come up with a test for Proxy.[[GetOwnProperty]] that tests the isExtensible error when the result of the trap is undefined >+ https://bugs.webkit.org/show_bug.cgi?id=154376 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * runtime/ProxyObject.cpp: >+ (JSC::ProxyObject::performInternalMethodGetOwnProperty): Remove resolved FIXME comments. >+ > 2019-06-10 Basuke Suzuki <Basuke.Suzuki@sony.com> > > [WinCairo] Remove build warning from RemoteInspector. >Index: Source/JavaScriptCore/runtime/ProxyObject.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/ProxyObject.cpp (revision 246067) >+++ Source/JavaScriptCore/runtime/ProxyObject.cpp (working copy) >@@ -253,14 +253,9 @@ bool ProxyObject::performInternalMethodG > throwVMTypeError(exec, scope, "When the result of 'getOwnPropertyDescriptor' is undefined the target must be configurable"_s); > return false; > } >- // FIXME: this doesn't work if 'target' is another Proxy. We don't have isExtensible implemented in a way that fits w/ Proxys. >- // https://bugs.webkit.org/show_bug.cgi?id=154375 > bool isExtensible = target->isExtensible(exec); > RETURN_IF_EXCEPTION(scope, false); > if (!isExtensible) { >- // FIXME: Come up with a test for this error. I'm not sure how to because >- // Object.seal(o) will make all fields [[Configurable]] false. >- // https://bugs.webkit.org/show_bug.cgi?id=154376 > throwVMTypeError(exec, scope, "When 'getOwnPropertyDescriptor' returns undefined, the 'target' of a Proxy should be extensible"_s); > return false; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 154376
:
371890
|
378900
|
379162
|
379509