WebKit Bugzilla
Attachment 359959 Details for
Bug 176810
: for..in on a Proxy loops over non enumerable properties
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
(1) [JSC] throw if 'ownKeys' Proxy trap result contains duplicate keys
bug-176810-20190123183408.patch (text/plain), 3.78 KB, created by
Caitlin Potter (:caitp)
on 2019-01-23 15:34:09 PST
(
hide
)
Description:
(1) [JSC] throw if 'ownKeys' Proxy trap result contains duplicate keys
Filename:
MIME Type:
Creator:
Caitlin Potter (:caitp)
Created:
2019-01-23 15:34:09 PST
Size:
3.78 KB
patch
obsolete
>Subversion Revision: 240301 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index c34ced4859fe3931fbbc2a2aa5f7cb5ce03beb94..bc5460edcf6e7cb2b4ddd04185d83dc16ff2ed98 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-23 Caitlin Potter <caitp@igalia.com> >+ >+ [JSC] throw if ownKeys Proxy trap result contains duplicate keys >+ https://bugs.webkit.org/show_bug.cgi?id=176810 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implements the normative spec change in https://github.com/tc39/ecma262/pull/833 >+ >+ * runtime/ProxyObject.cpp: >+ (JSC::ProxyObject::performGetOwnPropertyNames): >+ > 2019-01-22 Yusuke Suzuki <ysuzuki@apple.com> > > [JSC] Intl constructors should fit in sizeof(InternalFunction) >diff --git a/Source/JavaScriptCore/runtime/ProxyObject.cpp b/Source/JavaScriptCore/runtime/ProxyObject.cpp >index bbebf3a86ef56a4c34b33655f31828d0b1148f70..7e9f610307b157950b47a49bdfb2b6cb6034aa91 100644 >--- a/Source/JavaScriptCore/runtime/ProxyObject.cpp >+++ b/Source/JavaScriptCore/runtime/ProxyObject.cpp >@@ -950,6 +950,12 @@ void ProxyObject::performGetOwnPropertyNames(ExecState* exec, PropertyNameArray& > Identifier ident = value.toPropertyKey(exec); > RETURN_IF_EXCEPTION(scope, doExitEarly); > >+ if (uncheckedResultKeys.contains(ident.impl())) { >+ // If trapResult contains any duplicate entries, throw a TypeError exception. >+ throwTypeError(exec, scope, "Proxy handler's 'ownKeys' trap result must not contain any duplicate names"_s); >+ return doExitEarly; >+ } >+ > uncheckedResultKeys.add(ident.impl()); > trapResult.addUnchecked(ident.impl()); > return dontExitEarly; >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 7c6f04ef7e1fabcd8d397f4472fa59c431b49a6a..39206f5a42675243ed5ecfb35bd27282f1e6a7ec 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,16 @@ >+2019-01-23 Caitlin Potter <caitp@igalia.com> >+ >+ [JSC] throw if 'ownKeys' Proxy trap result contains duplicate keys >+ https://bugs.webkit.org/show_bug.cgi?id=176810 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This is for the normative spec change in https://github.com/tc39/ecma262/pull/833 >+ >+ Change some test expectations which were previously expected to fail. >+ >+ * web-platform-tests/fetch/api/headers/headers-record-expected.txt: >+ > 2019-01-22 Oriol Brufau <obrufau@igalia.com> > > [css-logical] Implement flow-relative margin, padding and border shorthands >diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-record-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-record-expected.txt >index 6147cbac0b24ec0c69935f9a1cb1c12c8d0377d2..ab448156e819e2ac54a103200f158d54a2248b28 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-record-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-record-expected.txt >@@ -9,7 +9,7 @@ PASS Correct operation ordering with two properties one of which has an invalid > PASS Correct operation ordering with two properties one of which has an invalid value > PASS Correct operation ordering with non-enumerable properties > PASS Correct operation ordering with undefined descriptors >-FAIL Correct operation ordering with repeated keys assert_throws: function "function () { var h = new Headers(proxy); }" did not throw >+PASS Correct operation ordering with repeated keys > FAIL Basic operation with Symbol keys assert_throws: function "function () { var h = new Headers(proxy); }" did not throw > FAIL Operation with non-enumerable Symbol keys assert_equals: expected 9 but got 8 >
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
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 176810
:
351389
|
351402
|
351405
|
351412
|
351468
|
351472
|
359910
|
359911
|
359912
|
359922
|
359930
|
359935
|
359937
|
359941
|
359952
|
359953
|
359955
|
359959
|
359961
|
359975
|
359979
|
359980
|
359988
|
360004
|
360032
|
362731
|
362762
|
362812
|
362896
|
366956
|
367326