WebKit Bugzilla
Attachment 360032 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]
(3) Fix [[OwnPropertyKeys]] algorithm in JSDOMConvertRecord
bug-176810-20190124164640.patch (text/plain), 4.45 KB, created by
Caitlin Potter (:caitp)
on 2019-01-24 13:46:41 PST
(
hide
)
Description:
(3) Fix [[OwnPropertyKeys]] algorithm in JSDOMConvertRecord
Filename:
MIME Type:
Creator:
Caitlin Potter (:caitp)
Created:
2019-01-24 13:46:41 PST
Size:
4.45 KB
patch
obsolete
>Subversion Revision: 240362 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 31aadd832dcae95fcbcbfea27fe4a7c474c2d45b..9edb668ee5b72327ce277dbfa7a8715c033fcc91 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2019-01-23 Caitlin Potter <caitp@igalia.com> >+ >+ Fix [[OwnPropertyKeys]] algorithm in JSDOMConvertRecord >+ https://bugs.webkit.org/show_bug.cgi?id=176810 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The [[OwnPropertyKeys]] internal method does not ignore Symbol keys by >+ default, however previously we had been doing this. >+ >+ This adds a little snippet to throw if a Symbol is found, otherwise it >+ would be converted to a String (and since the key is not a JSValue, we >+ can't rely on canonical error handling for this case). There are >+ web-platform-test cases which check for this. >+ >+ * bindings/js/JSDOMConvertRecord.h: >+ > 2019-01-23 Sihui Liu <sihui_liu@apple.com> > > Clean up IndexedDB files between tests >diff --git a/Source/WebCore/bindings/js/JSDOMConvertRecord.h b/Source/WebCore/bindings/js/JSDOMConvertRecord.h >index 75b2eb6aecd2c08db2ac3c4ca63077d119f8f587..4d260ddf726b8278404e5692acf265c5674f9e08 100644 >--- a/Source/WebCore/bindings/js/JSDOMConvertRecord.h >+++ b/Source/WebCore/bindings/js/JSDOMConvertRecord.h >@@ -85,7 +85,7 @@ template<typename K, typename V> struct Converter<IDLRecord<K, V>> : DefaultConv > ReturnType result; > > // 4. Let keys be ? O.[[OwnPropertyKeys]](). >- JSC::PropertyNameArray keys(&vm, JSC::PropertyNameMode::Strings, JSC::PrivateSymbolMode::Exclude); >+ JSC::PropertyNameArray keys(&vm, JSC::PropertyNameMode::StringsAndSymbols, JSC::PrivateSymbolMode::Exclude); > object->methodTable(vm)->getOwnPropertyNames(object, &state, keys, JSC::EnumerationMode()); > > RETURN_IF_EXCEPTION(scope, { }); >@@ -103,6 +103,12 @@ template<typename K, typename V> struct Converter<IDLRecord<K, V>> : DefaultConv > // enumeration mode? > > if (didGetDescriptor && descriptor.enumerable()) { >+ if (key.isSymbol()) { >+ // ToString(key) should fail in this case. >+ throwTypeError(&state, scope, "Cannot convert a symbol to a string"_s); >+ return { }; >+ } >+ > // 1. Let typedKey be key converted to an IDL value of type K. > auto typedKey = Detail::IdentifierConverter<K>::convert(state, key); > RETURN_IF_EXCEPTION(scope, { }); >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index e771668d5312d6c6b9db8ba1f54b64300bf9c543..96c742d2bf3cd89f2df8cc38ca64ef4ca46f22f4 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-24 Caitlin Potter <caitp@igalia.com> >+ >+ Fix [[OwnPropertyKeys]] algorithm in JSDOMConvertRecord >+ https://bugs.webkit.org/show_bug.cgi?id=176810 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Changes in Source/WebCore/bindings/js/JSDOMConvertRecord.h translate >+ into some new passing web-platform-tests. >+ >+ * web-platform-tests/fetch/api/headers/headers-record-expected.txt: >+ > 2019-01-23 Oriol Brufau <obrufau@igalia.com> > > [css-logical] Implement flow-relative inset properties >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..9f8047dda7c2665e0df775021099afa7fc7b6212 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 >@@ -10,6 +10,6 @@ PASS Correct operation ordering with two properties one of which has an invalid > 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 >-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 >+PASS Basic operation with Symbol keys >+PASS Operation with non-enumerable Symbol keys >
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 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