same-value-x-y-string.js (810B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 es6id: 19.1.2.10 5 description: > 6 Object.is ( value1, value2 ) 7 8 7.2.9 SameValue(x, y) 9 10 ... 11 7. If Type(x) is String, then 12 a. If x and y are exactly the same sequence of code units 13 (same length and same code units at corresponding indices) 14 return true; otherwise, return false. 15 ... 16 ---*/ 17 18 assert.sameValue(Object.is('', ''), true, "`Object.is('', '')` returns `true`"); 19 assert.sameValue( 20 Object.is('foo', 'foo'), 21 true, 22 "`Object.is('foo', 'foo')` returns `true`" 23 ); 24 assert.sameValue( 25 Object.is(String('foo'), String('foo')), 26 true, 27 "`Object.is(String('foo'), String('foo'))` returns `true`" 28 ); 29 30 reportCompare(0, 0);