string-iterator-generic.js does not test String iterators

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
6 years ago
4 years ago

People

(Reporter: anba, Unassigned)

Tracking

Trunk
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130409194949

Steps to reproduce:

Despite its name and description, js/src/jit-test/tests/for-of/string-iterator-generic.js does not test String iterators, but instead Array iterators.
(Assignee)

Updated

4 years ago
Assignee: general → nobody
I guess this bug is fixed by the patch for bug 919948.
  http://hg.mozilla.org/mozilla-central/diff/ceb4bd44eb34/js/src/jit-test/tests/for-of/string-iterator-generic.js

> --- a/js/src/jit-test/tests/for-of/string-iterator-generic.js
> +++ b/js/src/jit-test/tests/for-of/string-iterator-generic.js
> @@ -1,14 +1,15 @@
>  // String.prototype.iterator is generic.
>  
>  load(libdir + "asserts.js");
> +load(libdir + "iteration.js");
>  
>  function test(obj) {
> -    var it = Array.prototype.iterator.call(obj);
> +    var it = String.prototype[std_iterator].call(obj);
>      for (var i = 0; i < (obj.length >>> 0); i++)
> -        assertEq(it.next(), obj[i]);
> -    assertThrowsValue(function () { it.next(); }, StopIteration);
> +        assertIteratorResult(it.next(), obj[i], false);
> +    assertIteratorResult(it.next(), undefined, true);
>  }
(Reporter)

Comment 2

4 years ago
Resolved as WFM per comment 1.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.