Bug 160412 - [ES2016] Implement Object.entries
Summary: [ES2016] Implement Object.entries
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 160392 160844
  Show dependency treegraph
 
Reported: 2016-08-01 11:23 PDT by GSkachkov
Modified: 2017-03-13 12:41 PDT (History)
10 users (show)

See Also:


Attachments
Patch (8.39 KB, patch)
2016-08-11 14:15 PDT, GSkachkov
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-yosemite (905.88 KB, application/zip)
2016-08-11 15:03 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (939.60 KB, application/zip)
2016-08-11 15:07 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews126 for ios-simulator-elcapitan-wk2 (686.10 KB, application/zip)
2016-08-11 15:14 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews113 for mac-yosemite (1.46 MB, application/zip)
2016-08-11 15:15 PDT, Build Bot
no flags Details
Patch (12.43 KB, patch)
2016-08-12 02:16 PDT, GSkachkov
sbarati: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description GSkachkov 2016-08-01 11:23:08 PDT
Short example from ES2016 compatibility table:

/////////
var obj = Object.create({ a: "qux", d: "qux" });
obj.a = "foo"; obj.b = "bar"; obj.c = "baz";
var e = Object.entries(obj);
return Array.isArray(e)
&& e.length === 3
&& String(e[0]) === "a,foo"
&& String(e[1]) === "b,bar"
&& String(e[2]) === "c,baz";
///////
See description by following url https://github.com/tc39/proposal-object-values-entries
Comment 1 GSkachkov 2016-08-11 14:15:04 PDT
Created attachment 285854 [details]
Patch

Patch
Comment 2 Build Bot 2016-08-11 15:03:44 PDT
Comment on attachment 285854 [details]
Patch

Attachment 285854 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1853755

New failing tests:
js/Object-getOwnPropertyNames.html
Comment 3 Build Bot 2016-08-11 15:03:47 PDT
Created attachment 285857 [details]
Archive of layout-test-results from ews100 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 4 Build Bot 2016-08-11 15:07:41 PDT
Comment on attachment 285854 [details]
Patch

Attachment 285854 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1853764

New failing tests:
js/Object-getOwnPropertyNames.html
Comment 5 Build Bot 2016-08-11 15:07:45 PDT
Created attachment 285858 [details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 6 Build Bot 2016-08-11 15:14:12 PDT
Comment on attachment 285854 [details]
Patch

Attachment 285854 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1853766

New failing tests:
js/Object-getOwnPropertyNames.html
Comment 7 Build Bot 2016-08-11 15:14:15 PDT
Created attachment 285859 [details]
Archive of layout-test-results from ews126 for ios-simulator-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-elcapitan-wk2  Platform: Mac OS X 10.11.5
Comment 8 Build Bot 2016-08-11 15:15:53 PDT
Comment on attachment 285854 [details]
Patch

Attachment 285854 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1853768

New failing tests:
js/Object-getOwnPropertyNames.html
Comment 9 Build Bot 2016-08-11 15:15:58 PDT
Created attachment 285861 [details]
Archive of layout-test-results from ews113 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 10 GSkachkov 2016-08-12 02:16:57 PDT
Created attachment 285903 [details]
Patch

Fix layout tests
Comment 11 Saam Barati 2016-08-12 09:28:44 PDT
Comment on attachment 285903 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=285903&action=review

r=me

> JSTests/stress/object-entries.js:106
> +passed = arr2.length > 1 && arr2[0] === "ownKeys";

Can we make this assert exactly how lon the array is?

> JSTests/stress/object-entries.js:116
> +Array.prototype.push = function () { throw new Error("Array.prototype.push should not be used during invoking of Object.entries.")};

This is a good test. Can you also add one where you replace Reflect.getOwnPropertyDescriptor
to make sure the algorithm doesn't call that?
Comment 12 GSkachkov 2016-08-12 13:58:10 PDT
Committed r204419: <http://trac.webkit.org/changeset/204419>

All reviewed patches have been landed.  Closing bug.