{"action":"created","comment":{"url":"https://api.github.com/repos/svaarala/duktape/pulls/comments/87503721","pull_request_review_id":8115726,"id":87503721,"diff_hunk":"@@ -0,0 +1,147 @@\n+/*\n+ *  Object.assign() (E7 19.1.2.1)\n+ *  http://www.ecma-international.org/ecma-262/7.0/#sec-object.assign\n+ */\n+\n+/*===\n+basic tests\n+true\n+maggie Kittycow Machel Fatty Whale 812 1208 9001\n+0,1,2,pig,cow,ape,whale\n+maggie 1208 9001 Vegeta\n+cow,pig,ape,saiyan\n+undefined\n+this belongs here\n+undefined\n+prop1\n+get\n+set 812\n+===*/\n+\n+function basicTest() {\n+    var obj, src, dest;\n+\n+    // If no coercion is needed, target object is returned (i.e. not a copy).\n+    obj = {};\n+    dest = Object.assign(obj, { test: \"test\" });\n+    print(dest === obj);\n+\n+    // Properties are assigned in [[OwnPropertyKeys]] order, moving from left\n+    // to right in the argument list:\n+    //     1. Array indices (sequential, ascending)\n+    //     2. String keys (creation order)\n+    //     3. Symbol keys (creation order)\n+    // This behavior is easy to test for by assigning from multiple sources to\n+    // an empty object and then calling Reflect.ownKeys() on the result.\n+    obj = Object.assign({},\n+        { pig: \"maggie\", cow: \"Kittycow\", ape: \"Machel\" },\n+        [ 812, 1208, 9001 ],\n+        { whale: \"Fatty Whale\" });\n+    print(obj.pig, obj.cow, obj.ape, obj.whale, obj[0], obj[1], obj[2]);\n+    print(Reflect.ownKeys(obj));\n+\n+    // Existing properties in the target object can be overwritten.\n+    obj = Object.assign({ cow: 1208, pig: 812, ape: 9001 },\n+        { pig: \"maggie\", saiyan: \"Vegeta\" });\n+    print(obj.pig, obj.cow, obj.ape, obj.saiyan);\n+    print(Reflect.ownKeys(obj));\n+\n+    // Only enumerable own properties of the source(s) are used.\n+    src = Object.create({ inherited: \"something stupid happened\" }, {\n+        prop1: { enumerable: true,  value: \"this belongs here\" },\n+        prop2: { enumerable: false, value: \"something stupid happened\" }\n+    });\n+    obj = Object.assign({}, src);\n+    print(obj.inherited);\n+    print(obj.prop1);\n+    print(obj.prop2);\n+    print(Reflect.ownKeys(obj));\n+\n+    // Accessors in both target and source object(s) are called.\n+    obj = Object.create(Object.prototype, {\n+        prop: { set: function(value) { print(\"set\", value); }}\n+    });\n+    src = Object.create(Object.prototype, {\n+        prop: { enumerable: true, get: function() { print(\"get\"); return 812; }}\n+    });\n+    Object.assign(obj, src);\n+}\n+\n+try {\n+    print(\"basic tests\");\n+    basicTest();\n+} catch (e) {\n+    print(e.stack || e);\n+}\n+\n+/*===\n+coercion tests\n+true\n+something\n+true\n+TypeError\n+TypeError\n+===*/\n+\n+function coercionTest() {\n+    // The first argument to Object.assign() is ToObject() coerced.  The\n+    // coerced value is what's returned by the function.\n+    var obj = Object.assign(812, { test: \"something\" });\n+    print(obj instanceof Number);","path":"tests/ecmascript/test-bi-object-assign.js","position":90,"original_position":90,"commit_id":"ffacb9e83e3c1e19cfaad956281529e1bc4036ce","original_commit_id":"ffacb9e83e3c1e19cfaad956281529e1bc4036ce","user":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"body":"Right, it's just maybe not intuitive that `1 instanceof Number` is false but `new Number(1) instanceof Number` is true. At least it isn't for me :-)","created_at":"2016-11-10T22:49:06Z","updated_at":"2016-11-10T22:49:06Z","html_url":"https://github.com/svaarala/duktape/pull/1064#discussion_r87503721","pull_request_url":"https://api.github.com/repos/svaarala/duktape/pulls/1064","_links":{"self":{"href":"https://api.github.com/repos/svaarala/duktape/pulls/comments/87503721"},"html":{"href":"https://github.com/svaarala/duktape/pull/1064#discussion_r87503721"},"pull_request":{"href":"https://api.github.com/repos/svaarala/duktape/pulls/1064"}}},"pull_request":{"url":"https://api.github.com/repos/svaarala/duktape/pulls/1064","id":93090197,"html_url":"https://github.com/svaarala/duktape/pull/1064","diff_url":"https://github.com/svaarala/duktape/pull/1064.diff","patch_url":"https://github.com/svaarala/duktape/pull/1064.patch","issue_url":"https://api.github.com/repos/svaarala/duktape/issues/1064","number":1064,"state":"open","locked":false,"title":"Implement Object.assign()","user":{"login":"fatcerberus","id":4097841,"avatar_url":"https://avatars.githubusercontent.com/u/4097841?v=3","gravatar_id":"","url":"https://api.github.com/users/fatcerberus","html_url":"https://github.com/fatcerberus","followers_url":"https://api.github.com/users/fatcerberus/followers","following_url":"https://api.github.com/users/fatcerberus/following{/other_user}","gists_url":"https://api.github.com/users/fatcerberus/gists{/gist_id}","starred_url":"https://api.github.com/users/fatcerberus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatcerberus/subscriptions","organizations_url":"https://api.github.com/users/fatcerberus/orgs","repos_url":"https://api.github.com/users/fatcerberus/repos","events_url":"https://api.github.com/users/fatcerberus/events{/privacy}","received_events_url":"https://api.github.com/users/fatcerberus/received_events","type":"User","site_admin":false},"body":"This is a fully functional implementation of ES6 `Object.assign()`.\r\n\r\nThe changes in #1054 turned out to be convenient here.  Since `duk_enum()` respects ES6 [[OwnPropertyKeys]] ordering I was able to use it to implement `Object.assign()` without breaking compliance.","created_at":"2016-11-10T05:41:58Z","updated_at":"2016-11-10T22:49:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b88212227488903a1e888288108b885749090f98","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/svaarala/duktape/milestones/5","html_url":"https://github.com/svaarala/duktape/milestones/v2.0.0","labels_url":"https://api.github.com/repos/svaarala/duktape/milestones/5/labels","id":840957,"number":5,"title":"v2.0.0","description":"","creator":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"open_issues":65,"closed_issues":208,"state":"open","created_at":"2014-10-26T15:05:37Z","updated_at":"2016-11-10T12:27:44Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/svaarala/duktape/pulls/1064/commits","review_comments_url":"https://api.github.com/repos/svaarala/duktape/pulls/1064/comments","review_comment_url":"https://api.github.com/repos/svaarala/duktape/pulls/comments{/number}","comments_url":"https://api.github.com/repos/svaarala/duktape/issues/1064/comments","statuses_url":"https://api.github.com/repos/svaarala/duktape/statuses/ffacb9e83e3c1e19cfaad956281529e1bc4036ce","head":{"label":"fatcerberus:object-assign","ref":"object-assign","sha":"ffacb9e83e3c1e19cfaad956281529e1bc4036ce","user":{"login":"fatcerberus","id":4097841,"avatar_url":"https://avatars.githubusercontent.com/u/4097841?v=3","gravatar_id":"","url":"https://api.github.com/users/fatcerberus","html_url":"https://github.com/fatcerberus","followers_url":"https://api.github.com/users/fatcerberus/followers","following_url":"https://api.github.com/users/fatcerberus/following{/other_user}","gists_url":"https://api.github.com/users/fatcerberus/gists{/gist_id}","starred_url":"https://api.github.com/users/fatcerberus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatcerberus/subscriptions","organizations_url":"https://api.github.com/users/fatcerberus/orgs","repos_url":"https://api.github.com/users/fatcerberus/repos","events_url":"https://api.github.com/users/fatcerberus/events{/privacy}","received_events_url":"https://api.github.com/users/fatcerberus/received_events","type":"User","site_admin":false},"repo":{"id":35036428,"name":"duktape","full_name":"fatcerberus/duktape","owner":{"login":"fatcerberus","id":4097841,"avatar_url":"https://avatars.githubusercontent.com/u/4097841?v=3","gravatar_id":"","url":"https://api.github.com/users/fatcerberus","html_url":"https://github.com/fatcerberus","followers_url":"https://api.github.com/users/fatcerberus/followers","following_url":"https://api.github.com/users/fatcerberus/following{/other_user}","gists_url":"https://api.github.com/users/fatcerberus/gists{/gist_id}","starred_url":"https://api.github.com/users/fatcerberus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatcerberus/subscriptions","organizations_url":"https://api.github.com/users/fatcerberus/orgs","repos_url":"https://api.github.com/users/fatcerberus/repos","events_url":"https://api.github.com/users/fatcerberus/events{/privacy}","received_events_url":"https://api.github.com/users/fatcerberus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fatcerberus/duktape","description":"Duktape - embeddable Javascript engine with a focus on portability and compact footprint","fork":true,"url":"https://api.github.com/repos/fatcerberus/duktape","forks_url":"https://api.github.com/repos/fatcerberus/duktape/forks","keys_url":"https://api.github.com/repos/fatcerberus/duktape/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fatcerberus/duktape/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fatcerberus/duktape/teams","hooks_url":"https://api.github.com/repos/fatcerberus/duktape/hooks","issue_events_url":"https://api.github.com/repos/fatcerberus/duktape/issues/events{/number}","events_url":"https://api.github.com/repos/fatcerberus/duktape/events","assignees_url":"https://api.github.com/repos/fatcerberus/duktape/assignees{/user}","branches_url":"https://api.github.com/repos/fatcerberus/duktape/branches{/branch}","tags_url":"https://api.github.com/repos/fatcerberus/duktape/tags","blobs_url":"https://api.github.com/repos/fatcerberus/duktape/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fatcerberus/duktape/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fatcerberus/duktape/git/refs{/sha}","trees_url":"https://api.github.com/repos/fatcerberus/duktape/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fatcerberus/duktape/statuses/{sha}","languages_url":"https://api.github.com/repos/fatcerberus/duktape/languages","stargazers_url":"https://api.github.com/repos/fatcerberus/duktape/stargazers","contributors_url":"https://api.github.com/repos/fatcerberus/duktape/contributors","subscribers_url":"https://api.github.com/repos/fatcerberus/duktape/subscribers","subscription_url":"https://api.github.com/repos/fatcerberus/duktape/subscription","commits_url":"https://api.github.com/repos/fatcerberus/duktape/commits{/sha}","git_commits_url":"https://api.github.com/repos/fatcerberus/duktape/git/commits{/sha}","comments_url":"https://api.github.com/repos/fatcerberus/duktape/comments{/number}","issue_comment_url":"https://api.github.com/repos/fatcerberus/duktape/issues/comments{/number}","contents_url":"https://api.github.com/repos/fatcerberus/duktape/contents/{+path}","compare_url":"https://api.github.com/repos/fatcerberus/duktape/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fatcerberus/duktape/merges","archive_url":"https://api.github.com/repos/fatcerberus/duktape/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fatcerberus/duktape/downloads","issues_url":"https://api.github.com/repos/fatcerberus/duktape/issues{/number}","pulls_url":"https://api.github.com/repos/fatcerberus/duktape/pulls{/number}","milestones_url":"https://api.github.com/repos/fatcerberus/duktape/milestones{/number}","notifications_url":"https://api.github.com/repos/fatcerberus/duktape/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fatcerberus/duktape/labels{/name}","releases_url":"https://api.github.com/repos/fatcerberus/duktape/releases{/id}","deployments_url":"https://api.github.com/repos/fatcerberus/duktape/deployments","created_at":"2015-05-04T13:30:42Z","updated_at":"2016-01-11T04:56:49Z","pushed_at":"2016-11-10T16:11:06Z","git_url":"git://github.com/fatcerberus/duktape.git","ssh_url":"git@github.com:fatcerberus/duktape.git","clone_url":"https://github.com/fatcerberus/duktape.git","svn_url":"https://github.com/fatcerberus/duktape","homepage":null,"size":63249,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"svaarala:master","ref":"master","sha":"290ba807da1d4b4964793bba2eb0ded469b07b94","user":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"repo":{"id":15852088,"name":"duktape","full_name":"svaarala/duktape","owner":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/svaarala/duktape","description":"Duktape - embeddable Javascript engine with a focus on portability and compact footprint","fork":false,"url":"https://api.github.com/repos/svaarala/duktape","forks_url":"https://api.github.com/repos/svaarala/duktape/forks","keys_url":"https://api.github.com/repos/svaarala/duktape/keys{/key_id}","collaborators_url":"https://api.github.com/repos/svaarala/duktape/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/svaarala/duktape/teams","hooks_url":"https://api.github.com/repos/svaarala/duktape/hooks","issue_events_url":"https://api.github.com/repos/svaarala/duktape/issues/events{/number}","events_url":"https://api.github.com/repos/svaarala/duktape/events","assignees_url":"https://api.github.com/repos/svaarala/duktape/assignees{/user}","branches_url":"https://api.github.com/repos/svaarala/duktape/branches{/branch}","tags_url":"https://api.github.com/repos/svaarala/duktape/tags","blobs_url":"https://api.github.com/repos/svaarala/duktape/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/svaarala/duktape/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/svaarala/duktape/git/refs{/sha}","trees_url":"https://api.github.com/repos/svaarala/duktape/git/trees{/sha}","statuses_url":"https://api.github.com/repos/svaarala/duktape/statuses/{sha}","languages_url":"https://api.github.com/repos/svaarala/duktape/languages","stargazers_url":"https://api.github.com/repos/svaarala/duktape/stargazers","contributors_url":"https://api.github.com/repos/svaarala/duktape/contributors","subscribers_url":"https://api.github.com/repos/svaarala/duktape/subscribers","subscription_url":"https://api.github.com/repos/svaarala/duktape/subscription","commits_url":"https://api.github.com/repos/svaarala/duktape/commits{/sha}","git_commits_url":"https://api.github.com/repos/svaarala/duktape/git/commits{/sha}","comments_url":"https://api.github.com/repos/svaarala/duktape/comments{/number}","issue_comment_url":"https://api.github.com/repos/svaarala/duktape/issues/comments{/number}","contents_url":"https://api.github.com/repos/svaarala/duktape/contents/{+path}","compare_url":"https://api.github.com/repos/svaarala/duktape/compare/{base}...{head}","merges_url":"https://api.github.com/repos/svaarala/duktape/merges","archive_url":"https://api.github.com/repos/svaarala/duktape/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/svaarala/duktape/downloads","issues_url":"https://api.github.com/repos/svaarala/duktape/issues{/number}","pulls_url":"https://api.github.com/repos/svaarala/duktape/pulls{/number}","milestones_url":"https://api.github.com/repos/svaarala/duktape/milestones{/number}","notifications_url":"https://api.github.com/repos/svaarala/duktape/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/svaarala/duktape/labels{/name}","releases_url":"https://api.github.com/repos/svaarala/duktape/releases{/id}","deployments_url":"https://api.github.com/repos/svaarala/duktape/deployments","created_at":"2014-01-12T22:16:14Z","updated_at":"2016-11-10T16:09:05Z","pushed_at":"2016-11-10T20:55:39Z","git_url":"git://github.com/svaarala/duktape.git","ssh_url":"git@github.com:svaarala/duktape.git","clone_url":"https://github.com/svaarala/duktape.git","svn_url":"https://github.com/svaarala/duktape","homepage":null,"size":78786,"stargazers_count":2429,"watchers_count":2429,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":227,"mirror_url":null,"open_issues_count":256,"forks":227,"open_issues":256,"watchers":2429,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/svaarala/duktape/pulls/1064"},"html":{"href":"https://github.com/svaarala/duktape/pull/1064"},"issue":{"href":"https://api.github.com/repos/svaarala/duktape/issues/1064"},"comments":{"href":"https://api.github.com/repos/svaarala/duktape/issues/1064/comments"},"review_comments":{"href":"https://api.github.com/repos/svaarala/duktape/pulls/1064/comments"},"review_comment":{"href":"https://api.github.com/repos/svaarala/duktape/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/svaarala/duktape/pulls/1064/commits"},"statuses":{"href":"https://api.github.com/repos/svaarala/duktape/statuses/ffacb9e83e3c1e19cfaad956281529e1bc4036ce"}}}}
{"actor":{"display_login":"svaarala"}}