diff options
Diffstat (limited to 'test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js')
-rw-r--r-- | test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js index 21e3ef508..d5ec47052 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js @@ -9,17 +9,17 @@ description: > Object, and has an own toString method ---*/ - // objects inherit the default valueOf() method from Object - // that simply returns itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - var fromIndex = { - toString: function () { - return '2'; - } - }; - var targetObj = new RegExp(); +// objects inherit the default valueOf() method from Object +// that simply returns itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +var fromIndex = { + toString: function() { + return '2'; + } +}; +var targetObj = new RegExp(); assert.sameValue([0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex), 2, '[0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex)'); assert.sameValue([0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex), -1, '[0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex)'); |