Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: third_party/WebKit/LayoutTests/bindings/record-type.html

Issue 2801003005: bindings: Skip undefined property descriptors when creating records. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/bindings/record-type.html
diff --git a/third_party/WebKit/LayoutTests/bindings/record-type.html b/third_party/WebKit/LayoutTests/bindings/record-type.html
index 190c21bd850f3ffd2ae6c0262f2eaf98ea683dee..8100f562caabd8c91545cf4a016005de739e3b1a 100644
--- a/third_party/WebKit/LayoutTests/bindings/record-type.html
+++ b/third_party/WebKit/LayoutTests/bindings/record-type.html
@@ -31,6 +31,24 @@
test(() => {
let recordTest = internals.recordTest();
+ let record = {'foo': 42, 'quux': 34};
+ let handler = {
+ getOwnPropertyDescriptor: (target, name) => {
+ if (name == 'quux')
+ return undefined;
+ return Reflect.getOwnPropertyDescriptor(target, name);
+ }
+ };
+ var recordProxy = new Proxy(record, handler);
+ recordTest.setStringLongRecord(record);
+ assert_record_equals(
+ recordTest.getStringLongRecord(), [['foo', 42]],
+ "Entries whose getOwnPropertyDescriptor return undefined are skipped");
+ }, "Test GetOwnPropertyDescriptor() returning undefined");
+
+ test(() => {
+ let recordTest = internals.recordTest();
+
recordTest.setStringLongRecord({a: true, false: null, c: "foo"});
assert_record_equals(recordTest.getStringLongRecord(),
[['a', 1], ['false', 0], ['c', 0]],
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698