Closed
Bug 383164
Opened 18 years ago
Closed 18 years ago
Javascript error required for Generators that return
Categories
(Rhino Graveyard :: Core, enhancement)
Tracking
(Not tracked)
RESOLVED
FIXED
1.7R1
People
(Reporter: roshanj, Assigned: roshanj)
References
Details
Attachments
(1 file)
5.77 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Build Identifier: 1.6R6
A generator that returns a values must be flagged by an error;.
function (x) {
yield x;
return x+1;
}
Must be flagged by an error.
Reproducible: Always
Updated•18 years ago
|
Assignee: nobody → roshanj
Updated•18 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•18 years ago
|
Assignee | ||
Comment 1•18 years ago
|
||
The patch adds the required error messages. These errors are flagged all the time (not just on strict mode).
Strict mode warnings have been extended to do reachability analysis that accommodates mismatched uses of yield and value-returns.
js> function foo(x) { var a = 10; x =x + 1; if(x < 1) { return x; } yield x; yield x + 1; }
js: "<stdin>", line 2: generator function foo returns a value
js: function foo(x) { var a = 10; x =x + 1; if(x < 1) { return x; } yield x; yield x + 1; }
js: .......................................................................^
js: "<stdin>", line 2: Compilation produced 1 syntax errors.
Comment 2•18 years ago
|
||
Committed patch on date: 2007/06/06 14:32:39 and enabled test.
Marking fixed.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•