{"action":"created","comment":{"url":"https://api.github.com/repos/jquery/qunit/pulls/comments/35238996","id":35238996,"diff_hunk":"@@ -1528,3 +1528,226 @@ QUnit.test( \"Test that must be done at the end because they extend some primitiv\n \t\t);\n \t}\n );\n+\n+QUnit.module( \"equiv Maps and Sets\");\n+// Note: we cannot do simple check for constructor existence,\n+// as IE 11 implementation of Sets/Maps is incomplete.\n+//  - in IE 11, Sets/Maps do not support constructors, e.g. new Set( [1] ) fails.\n+//  - in IE 11, QUnit.objectType( new Set() ) === 'object'\n+//\n+// This is a more robust way of checking for ES6 Set/Map support.\n+var hasES6Set = (function() {\n+\ttry {\n+\t\tvar s = new Set([ 1, 2, 3 ]);\n+\t\tif (s.size !== 3 || !s.has(2)) {\n+\t\t\treturn false;\n+\t\t}\n+\t}\n+\tcatch (e) {\n+\t\treturn false;\n+\t}\n+\n+\treturn true;\n+})();\n+\n+var hasES6Map = (function() {\n+\ttry {\n+\t\tvar m = new Map([\n+\t\t\t[ 1, 2],\n+\t\t\t[ 3, 4]\n+\t\t]);\n+\t\tif (m.size !== 2 || !m.has(1)) {\n+\t\t\treturn false;\n+\t\t}\n+\t}\n+\tcatch (e) {\n+\t\treturn false;\n+\t}\n+\n+\treturn true;\n+})();\n+\n+QUnit[ hasES6Set ? \"test\" : \"skip\" ](\"Sets\", function ( assert ) {\n+\tvar s1, s2, s3, s4, o1, o2, o3, m1, m2, m3;\n+\n+\t// Empty sets\n+\ts1 = new Set();\n+\ts2 = new Set();\n+\tassert.equal( QUnit.equiv( s1, s2 ), true, \"Empty Sets\");\n+\ts1 = new Set([]);\n+\ts2 = new Set([]);\n+\tassert.equal( QUnit.equiv( s1, s2 ), true, \"Empty sets init with empty arrays\");\n+\n+\t// Simple cases\n+\ts1 = new Set( [1] );\n+\ts2 = new Set( [1] );\n+\ts3 = new Set( [3] );\n+\tassert.equal( QUnit.equiv( s1, s2 ), true, \"Single element sets [1] vs [1]\");\n+\tassert.equal( QUnit.equiv( s1, s3 ), false, \"Single element sets [1] vs [3]\");\n+\n+\t// Tricky values\n+\ts1 = new Set();\n+\ts1.add( undefined );\n+\ts1.add( null );\n+\ts1.add( false );\n+\ts1.add( 0 );\n+\ts1.add( NaN );\n+\ts1.add( Infinity );\n+\ts1.add( -Infinity );\n+\ts2 = new Set([ undefined, null, false, 0, NaN, Infinity, -Infinity ]);\n+\tassert.equal( QUnit.equiv( s1, s2 ), true, \"Mutiple-element sets of tricky values\");\n+\n+\t// Sets Containing objects\n+\to1 = {\"foo\": 0, \"bar\": true};\n+\to2 = {\"foo\": 0, \"bar\": true};\n+\to3 = {\"foo\": 1, \"bar\": true};\n+\ts1 = new Set([ o1, o3 ]);\n+\ts2 = new Set([ o1, o3 ]);\n+\tassert.equal( QUnit.equiv( s1, s2 ), true, \"Sets containing same objects\");\n+\ts1 = new Set([ o1 ]);\n+\ts2 = new Set([ o2 ]);\n+\tassert.equal( QUnit.equiv( s1, s2 ), true, \"Sets containing deeply-equal objects\");\n+\ts1 = new Set([ o1 ]);\n+\ts2 = new Set([ o3 ]);\n+\tassert.equal( QUnit.equiv( s1, s2 ), false, \"Sets containing different objects\");\n+\n+\t// Sets containing sets\n+\ts1 = new Set([ 1, 2, 3 ]);\n+\ts2 = new Set([ 1, 2, 3 ]);\n+\ts3 = new Set([ s1 ]);\n+\ts4 = new Set([ s2 ]);\n+\tassert.equal( QUnit.equiv( s3, s4 ), true, \"Sets containing deeply-equal sets\");\n+\t\n+\t// Sets containing different sets\n+\ts1 = new Set([ 1, 2, 3 ]);\n+\ts2 = new Set([ 1, 2, 3, 4 ]);\n+\ts3 = new Set([ s1 ]);\n+\ts4 = new Set([ s2 ]);\n+\tassert.equal( QUnit.equiv( s3, s4 ), false, \"Sets containing different sets\");\n+\t\n+\t// Sets containing maps\n+\tm1 = new Map([ [ 1,1 ] ]);\n+\tm2 = new Map([ [ 1,1 ] ]);\n+\tm3 = new Map([ [ 1,3 ] ]);\n+\ts3 = new Set([ m1 ]);\n+\ts4 = new Set([ m2 ]);\n+\tassert.equal( QUnit.equiv( s3, s4 ), true, \"Sets containing different but deeply-equal maps\");\n+\ts3 = new Set([ m1 ]);\n+\ts4 = new Set([ m3 ]);\n+\tassert.equal( QUnit.equiv( s3, s4 ), false, \"Sets containing different maps\");\n+});\n+\n+QUnit[ hasES6Map ? \"test\" : \"skip\" ](\"Maps\", function ( assert ) {\n+\tvar m1, m2, m3, m4, o1, o2, o3, s1, s2, s3;\n+\n+\t// Empty maps\n+\tm1 = new Map();\n+\tm2 = new Map();\n+\tassert.equal( QUnit.equiv(m1, m2), true, \"Empty maps\");\n+\tm1 = new Map([]);","path":"test/main/deepEqual.js","position":120,"original_position":120,"commit_id":"9cdba06ca3d828326b0793d0fa5958294f645c99","original_commit_id":"9cdba06ca3d828326b0793d0fa5958294f645c99","user":{"login":"leobalter","id":301201,"avatar_url":"https://avatars.githubusercontent.com/u/301201?v=3","gravatar_id":"","url":"https://api.github.com/users/leobalter","html_url":"https://github.com/leobalter","followers_url":"https://api.github.com/users/leobalter/followers","following_url":"https://api.github.com/users/leobalter/following{/other_user}","gists_url":"https://api.github.com/users/leobalter/gists{/gist_id}","starred_url":"https://api.github.com/users/leobalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leobalter/subscriptions","organizations_url":"https://api.github.com/users/leobalter/orgs","repos_url":"https://api.github.com/users/leobalter/repos","events_url":"https://api.github.com/users/leobalter/events{/privacy}","received_events_url":"https://api.github.com/users/leobalter/received_events","type":"User","site_admin":false},"body":"```js\r\nassert.equal( QUnit.equiv(m1, m2), true, \"Empty maps\");\r\nm1 = new Map([]);\r\n```\r\nto:\r\n\r\n```js\r\nassert.equal( QUnit.equiv( m1, m2 ), true, \"Empty maps\" );\r\nm1 = new Map( [] );\r\n```\r\n\r\n","created_at":"2015-07-22T17:23:53Z","updated_at":"2015-07-22T17:23:53Z","html_url":"https://github.com/jquery/qunit/pull/834#discussion_r35238996","pull_request_url":"https://api.github.com/repos/jquery/qunit/pulls/834","_links":{"self":{"href":"https://api.github.com/repos/jquery/qunit/pulls/comments/35238996"},"html":{"href":"https://github.com/jquery/qunit/pull/834#discussion_r35238996"},"pull_request":{"href":"https://api.github.com/repos/jquery/qunit/pulls/834"}}},"pull_request":{"url":"https://api.github.com/repos/jquery/qunit/pulls/834","id":39930048,"html_url":"https://github.com/jquery/qunit/pull/834","diff_url":"https://github.com/jquery/qunit/pull/834.diff","patch_url":"https://github.com/jquery/qunit/pull/834.patch","issue_url":"https://api.github.com/repos/jquery/qunit/issues/834","number":834,"state":"open","locked":false,"title":"Added ES6 Set and Map support","user":{"login":"godchuanz","id":7733689,"avatar_url":"https://avatars.githubusercontent.com/u/7733689?v=3","gravatar_id":"","url":"https://api.github.com/users/godchuanz","html_url":"https://github.com/godchuanz","followers_url":"https://api.github.com/users/godchuanz/followers","following_url":"https://api.github.com/users/godchuanz/following{/other_user}","gists_url":"https://api.github.com/users/godchuanz/gists{/gist_id}","starred_url":"https://api.github.com/users/godchuanz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godchuanz/subscriptions","organizations_url":"https://api.github.com/users/godchuanz/orgs","repos_url":"https://api.github.com/users/godchuanz/repos","events_url":"https://api.github.com/users/godchuanz/events{/privacy}","received_events_url":"https://api.github.com/users/godchuanz/received_events","type":"User","site_admin":false},"body":"The main idea is to reduce ES6 Set and Map comparisons into Array comparisons.\r\n\r\nRef: https://github.com/jquery/qunit/issues/833","created_at":"2015-07-14T15:44:51Z","updated_at":"2015-07-22T17:23:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11f9f304e9793aeeed88c8292fc2af25a7d7476c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jquery/qunit/pulls/834/commits","review_comments_url":"https://api.github.com/repos/jquery/qunit/pulls/834/comments","review_comment_url":"https://api.github.com/repos/jquery/qunit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jquery/qunit/issues/834/comments","statuses_url":"https://api.github.com/repos/jquery/qunit/statuses/9cdba06ca3d828326b0793d0fa5958294f645c99","head":{"label":"godchuanz:es6-set-map-support","ref":"es6-set-map-support","sha":"9cdba06ca3d828326b0793d0fa5958294f645c99","user":{"login":"godchuanz","id":7733689,"avatar_url":"https://avatars.githubusercontent.com/u/7733689?v=3","gravatar_id":"","url":"https://api.github.com/users/godchuanz","html_url":"https://github.com/godchuanz","followers_url":"https://api.github.com/users/godchuanz/followers","following_url":"https://api.github.com/users/godchuanz/following{/other_user}","gists_url":"https://api.github.com/users/godchuanz/gists{/gist_id}","starred_url":"https://api.github.com/users/godchuanz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godchuanz/subscriptions","organizations_url":"https://api.github.com/users/godchuanz/orgs","repos_url":"https://api.github.com/users/godchuanz/repos","events_url":"https://api.github.com/users/godchuanz/events{/privacy}","received_events_url":"https://api.github.com/users/godchuanz/received_events","type":"User","site_admin":false},"repo":{"id":39083766,"name":"qunit","full_name":"godchuanz/qunit","owner":{"login":"godchuanz","id":7733689,"avatar_url":"https://avatars.githubusercontent.com/u/7733689?v=3","gravatar_id":"","url":"https://api.github.com/users/godchuanz","html_url":"https://github.com/godchuanz","followers_url":"https://api.github.com/users/godchuanz/followers","following_url":"https://api.github.com/users/godchuanz/following{/other_user}","gists_url":"https://api.github.com/users/godchuanz/gists{/gist_id}","starred_url":"https://api.github.com/users/godchuanz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godchuanz/subscriptions","organizations_url":"https://api.github.com/users/godchuanz/orgs","repos_url":"https://api.github.com/users/godchuanz/repos","events_url":"https://api.github.com/users/godchuanz/events{/privacy}","received_events_url":"https://api.github.com/users/godchuanz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/godchuanz/qunit","description":"An easy-to-use JavaScript Unit Testing framework.","fork":true,"url":"https://api.github.com/repos/godchuanz/qunit","forks_url":"https://api.github.com/repos/godchuanz/qunit/forks","keys_url":"https://api.github.com/repos/godchuanz/qunit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/godchuanz/qunit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/godchuanz/qunit/teams","hooks_url":"https://api.github.com/repos/godchuanz/qunit/hooks","issue_events_url":"https://api.github.com/repos/godchuanz/qunit/issues/events{/number}","events_url":"https://api.github.com/repos/godchuanz/qunit/events","assignees_url":"https://api.github.com/repos/godchuanz/qunit/assignees{/user}","branches_url":"https://api.github.com/repos/godchuanz/qunit/branches{/branch}","tags_url":"https://api.github.com/repos/godchuanz/qunit/tags","blobs_url":"https://api.github.com/repos/godchuanz/qunit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/godchuanz/qunit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/godchuanz/qunit/git/refs{/sha}","trees_url":"https://api.github.com/repos/godchuanz/qunit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/godchuanz/qunit/statuses/{sha}","languages_url":"https://api.github.com/repos/godchuanz/qunit/languages","stargazers_url":"https://api.github.com/repos/godchuanz/qunit/stargazers","contributors_url":"https://api.github.com/repos/godchuanz/qunit/contributors","subscribers_url":"https://api.github.com/repos/godchuanz/qunit/subscribers","subscription_url":"https://api.github.com/repos/godchuanz/qunit/subscription","commits_url":"https://api.github.com/repos/godchuanz/qunit/commits{/sha}","git_commits_url":"https://api.github.com/repos/godchuanz/qunit/git/commits{/sha}","comments_url":"https://api.github.com/repos/godchuanz/qunit/comments{/number}","issue_comment_url":"https://api.github.com/repos/godchuanz/qunit/issues/comments{/number}","contents_url":"https://api.github.com/repos/godchuanz/qunit/contents/{+path}","compare_url":"https://api.github.com/repos/godchuanz/qunit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/godchuanz/qunit/merges","archive_url":"https://api.github.com/repos/godchuanz/qunit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/godchuanz/qunit/downloads","issues_url":"https://api.github.com/repos/godchuanz/qunit/issues{/number}","pulls_url":"https://api.github.com/repos/godchuanz/qunit/pulls{/number}","milestones_url":"https://api.github.com/repos/godchuanz/qunit/milestones{/number}","notifications_url":"https://api.github.com/repos/godchuanz/qunit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/godchuanz/qunit/labels{/name}","releases_url":"https://api.github.com/repos/godchuanz/qunit/releases{/id}","created_at":"2015-07-14T15:34:14Z","updated_at":"2015-07-14T15:34:15Z","pushed_at":"2015-07-22T16:20:03Z","git_url":"git://github.com/godchuanz/qunit.git","ssh_url":"git@github.com:godchuanz/qunit.git","clone_url":"https://github.com/godchuanz/qunit.git","svn_url":"https://github.com/godchuanz/qunit","homepage":"http://qunitjs.com","size":1386,"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":"jquery:master","ref":"master","sha":"29ca2e87c420f6dfdef793b034a67cff9a666df5","user":{"login":"jquery","id":70142,"avatar_url":"https://avatars.githubusercontent.com/u/70142?v=3","gravatar_id":"","url":"https://api.github.com/users/jquery","html_url":"https://github.com/jquery","followers_url":"https://api.github.com/users/jquery/followers","following_url":"https://api.github.com/users/jquery/following{/other_user}","gists_url":"https://api.github.com/users/jquery/gists{/gist_id}","starred_url":"https://api.github.com/users/jquery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquery/subscriptions","organizations_url":"https://api.github.com/users/jquery/orgs","repos_url":"https://api.github.com/users/jquery/repos","events_url":"https://api.github.com/users/jquery/events{/privacy}","received_events_url":"https://api.github.com/users/jquery/received_events","type":"Organization","site_admin":false},"repo":{"id":259691,"name":"qunit","full_name":"jquery/qunit","owner":{"login":"jquery","id":70142,"avatar_url":"https://avatars.githubusercontent.com/u/70142?v=3","gravatar_id":"","url":"https://api.github.com/users/jquery","html_url":"https://github.com/jquery","followers_url":"https://api.github.com/users/jquery/followers","following_url":"https://api.github.com/users/jquery/following{/other_user}","gists_url":"https://api.github.com/users/jquery/gists{/gist_id}","starred_url":"https://api.github.com/users/jquery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquery/subscriptions","organizations_url":"https://api.github.com/users/jquery/orgs","repos_url":"https://api.github.com/users/jquery/repos","events_url":"https://api.github.com/users/jquery/events{/privacy}","received_events_url":"https://api.github.com/users/jquery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jquery/qunit","description":"An easy-to-use JavaScript Unit Testing framework.","fork":false,"url":"https://api.github.com/repos/jquery/qunit","forks_url":"https://api.github.com/repos/jquery/qunit/forks","keys_url":"https://api.github.com/repos/jquery/qunit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jquery/qunit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jquery/qunit/teams","hooks_url":"https://api.github.com/repos/jquery/qunit/hooks","issue_events_url":"https://api.github.com/repos/jquery/qunit/issues/events{/number}","events_url":"https://api.github.com/repos/jquery/qunit/events","assignees_url":"https://api.github.com/repos/jquery/qunit/assignees{/user}","branches_url":"https://api.github.com/repos/jquery/qunit/branches{/branch}","tags_url":"https://api.github.com/repos/jquery/qunit/tags","blobs_url":"https://api.github.com/repos/jquery/qunit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jquery/qunit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jquery/qunit/git/refs{/sha}","trees_url":"https://api.github.com/repos/jquery/qunit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jquery/qunit/statuses/{sha}","languages_url":"https://api.github.com/repos/jquery/qunit/languages","stargazers_url":"https://api.github.com/repos/jquery/qunit/stargazers","contributors_url":"https://api.github.com/repos/jquery/qunit/contributors","subscribers_url":"https://api.github.com/repos/jquery/qunit/subscribers","subscription_url":"https://api.github.com/repos/jquery/qunit/subscription","commits_url":"https://api.github.com/repos/jquery/qunit/commits{/sha}","git_commits_url":"https://api.github.com/repos/jquery/qunit/git/commits{/sha}","comments_url":"https://api.github.com/repos/jquery/qunit/comments{/number}","issue_comment_url":"https://api.github.com/repos/jquery/qunit/issues/comments{/number}","contents_url":"https://api.github.com/repos/jquery/qunit/contents/{+path}","compare_url":"https://api.github.com/repos/jquery/qunit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jquery/qunit/merges","archive_url":"https://api.github.com/repos/jquery/qunit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jquery/qunit/downloads","issues_url":"https://api.github.com/repos/jquery/qunit/issues{/number}","pulls_url":"https://api.github.com/repos/jquery/qunit/pulls{/number}","milestones_url":"https://api.github.com/repos/jquery/qunit/milestones{/number}","notifications_url":"https://api.github.com/repos/jquery/qunit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jquery/qunit/labels{/name}","releases_url":"https://api.github.com/repos/jquery/qunit/releases{/id}","created_at":"2009-07-24T16:26:23Z","updated_at":"2015-07-22T15:36:45Z","pushed_at":"2015-07-22T16:20:04Z","git_url":"git://github.com/jquery/qunit.git","ssh_url":"git@github.com:jquery/qunit.git","clone_url":"https://github.com/jquery/qunit.git","svn_url":"https://github.com/jquery/qunit","homepage":"http://qunitjs.com","size":4724,"stargazers_count":3213,"watchers_count":3213,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":660,"mirror_url":null,"open_issues_count":53,"forks":660,"open_issues":53,"watchers":3213,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jquery/qunit/pulls/834"},"html":{"href":"https://github.com/jquery/qunit/pull/834"},"issue":{"href":"https://api.github.com/repos/jquery/qunit/issues/834"},"comments":{"href":"https://api.github.com/repos/jquery/qunit/issues/834/comments"},"review_comments":{"href":"https://api.github.com/repos/jquery/qunit/pulls/834/comments"},"review_comment":{"href":"https://api.github.com/repos/jquery/qunit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jquery/qunit/pulls/834/commits"},"statuses":{"href":"https://api.github.com/repos/jquery/qunit/statuses/9cdba06ca3d828326b0793d0fa5958294f645c99"}}}}