WebKit Bugzilla
Attachment 372369 Details for
Bug 198755
: Proxy constructor should throw if handler is revoked Proxy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198755-20190618231615.patch (text/plain), 4.35 KB, created by
Alexey Shvayka
on 2019-06-18 13:16:16 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alexey Shvayka
Created:
2019-06-18 13:16:16 PDT
Size:
4.35 KB
patch
obsolete
>Index: JSTests/ChangeLog >=================================================================== >--- JSTests/ChangeLog (revision 246560) >+++ JSTests/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2019-06-18 Alexey Shvayka <shvaikalesh@gmail.com> >+ >+ Proxy constructor should throw if handler is revoked Proxy >+ https://bugs.webkit.org/show_bug.cgi?id=198755 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * stress/proxy-revoke.js: Reword error message. >+ * test262/expectations.yaml: Mark 2 test cases as passing. >+ > 2019-06-18 Tadeu Zagallo <tzagallo@apple.com> > > DFG code should not reify the names of builtin functions with private names >Index: JSTests/stress/proxy-revoke.js >=================================================================== >--- JSTests/stress/proxy-revoke.js (revision 246558) >+++ JSTests/stress/proxy-revoke.js (working copy) >@@ -95,7 +95,7 @@ function assert(b) { > new Proxy(proxy, {}); > } catch(e) { > threw = true; >- assert(e.toString() === "TypeError: If a Proxy's handler is another Proxy object, the other Proxy should not have been revoked"); >+ assert(e.toString() === "TypeError: A Proxy's 'target' shouldn't be a revoked Proxy"); > } > assert(threw); > } >Index: JSTests/test262/expectations.yaml >=================================================================== >--- JSTests/test262/expectations.yaml (revision 246558) >+++ JSTests/test262/expectations.yaml (working copy) >@@ -1179,9 +1179,6 @@ test/built-ins/Proxy/construct/return-no > test/built-ins/Proxy/construct/trap-is-not-callable-realm.js: > default: 'Test262Error: Expected a TypeError but got a TypeError' > strict mode: 'Test262Error: Expected a TypeError but got a TypeError' >-test/built-ins/Proxy/create-handler-is-revoked-proxy.js: >- default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' >- strict mode: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' > test/built-ins/Proxy/defineProperty/targetdesc-not-configurable-writable-desc-not-writable.js: > default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' > strict mode: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' >Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 246558) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2019-06-18 Alexey Shvayka <shvaikalesh@gmail.com> >+ >+ Proxy constructor should throw if handler is revoked Proxy >+ https://bugs.webkit.org/show_bug.cgi?id=198755 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Reword error message and check if handler is revoked Proxy. >+ (step 4 of https://tc39.es/ecma262/#sec-proxycreate) >+ >+ * runtime/ProxyObject.cpp: >+ (JSC::ProxyObject::finishCreation): Add isRevoked check. >+ > 2019-06-18 Tadeu Zagallo <tzagallo@apple.com> > > DFG code should not reify the names of builtin functions with private names >Index: Source/JavaScriptCore/runtime/ProxyObject.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/ProxyObject.cpp (revision 246558) >+++ Source/JavaScriptCore/runtime/ProxyObject.cpp (working copy) >@@ -91,8 +91,8 @@ void ProxyObject::finishCreation(VM& vm, > return; > } > if (ProxyObject* targetAsProxy = jsDynamicCast<ProxyObject*>(vm, target)) { >- if (targetAsProxy->handler().isNull()) { >- throwTypeError(exec, scope, "If a Proxy's handler is another Proxy object, the other Proxy should not have been revoked"_s); >+ if (targetAsProxy->isRevoked()) { >+ throwTypeError(exec, scope, "A Proxy's 'target' shouldn't be a revoked Proxy"_s); > return; > } > } >@@ -100,6 +100,12 @@ void ProxyObject::finishCreation(VM& vm, > throwTypeError(exec, scope, "A Proxy's 'handler' should be an Object"_s); > return; > } >+ if (ProxyObject* handlerAsProxy = jsDynamicCast<ProxyObject*>(vm, handler)) { >+ if (handlerAsProxy->isRevoked()) { >+ throwTypeError(exec, scope, "A Proxy's 'handler' shouldn't be a revoked Proxy"_s); >+ return; >+ } >+ } > > JSObject* targetAsObject = jsCast<JSObject*>(target); >
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 198755
:
371852
|
372369
|
376082
|
376722