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

Side by Side Diff: src/v8natives.js

Issue 642353002: Object.is to use SameValue - Closes #3576 Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file relies on the fact that the following declarations have been made 5 // This file relies on the fact that the following declarations have been made
6 // in runtime.js: 6 // in runtime.js:
7 // var $Object = global.Object; 7 // var $Object = global.Object;
8 // var $Boolean = global.Boolean; 8 // var $Boolean = global.Boolean;
9 // var $Number = global.Number; 9 // var $Number = global.Number;
10 // var $Function = global.Function; 10 // var $Function = global.Function;
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 } 1359 }
1360 if (%IsJSProxy(obj)) { 1360 if (%IsJSProxy(obj)) {
1361 return true; 1361 return true;
1362 } 1362 }
1363 return %IsExtensible(obj); 1363 return %IsExtensible(obj);
1364 } 1364 }
1365 1365
1366 1366
1367 // Harmony egal. 1367 // Harmony egal.
1368 function ObjectIs(obj1, obj2) { 1368 function ObjectIs(obj1, obj2) {
1369 if (obj1 === obj2) { 1369 return SameValue(obj1, obj2);
1370 return (obj1 !== 0) || (1 / obj1 === 1 / obj2);
1371 } else {
1372 return (obj1 !== obj1) && (obj2 !== obj2);
1373 }
1374 } 1370 }
1375 1371
1376 1372
1377 // ECMA-262, Edition 6, section B.2.2.1.1 1373 // ECMA-262, Edition 6, section B.2.2.1.1
1378 function ObjectGetProto() { 1374 function ObjectGetProto() {
1379 return %GetPrototype(ToObject(this)); 1375 return %GetPrototype(ToObject(this));
1380 } 1376 }
1381 1377
1382 1378
1383 // ECMA-262, Edition 6, section B.2.2.1.2 1379 // ECMA-262, Edition 6, section B.2.2.1.2
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 } 1902 }
1907 if (!IS_SPEC_FUNCTION(method)) { 1903 if (!IS_SPEC_FUNCTION(method)) {
1908 throw MakeTypeError('not_iterable', [obj]); 1904 throw MakeTypeError('not_iterable', [obj]);
1909 } 1905 }
1910 var iterator = %_CallFunction(obj, method); 1906 var iterator = %_CallFunction(obj, method);
1911 if (!IS_SPEC_OBJECT(iterator)) { 1907 if (!IS_SPEC_OBJECT(iterator)) {
1912 throw MakeTypeError('not_an_iterator', [iterator]); 1908 throw MakeTypeError('not_an_iterator', [iterator]);
1913 } 1909 }
1914 return iterator; 1910 return iterator;
1915 } 1911 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698