Open Bug 1321616 Opened 3 years ago Updated Last year

Calling Function constructor with single line comments in parameters part throws SyntaxError

Categories

(Core :: JavaScript: Standard Library, defect, P5)

defect

Tracking

()

Tracking Status
firefox53 --- affected

People

(Reporter: anba, Unassigned)

References

(Blocks 1 open bug)

Details

Test case:
---
Function("//", "");

Function("<!--", "");
---

Expected: No SyntaxError
Actual: Throws SyntaxError
bug 1317400 should fix this issue, because the toString revision proposal adds a newline terminator at the end of the parameters list.
Depends on: 1317400
The two issues in comment #0 have been fixed, but `Function("-->", "")` still throws a SyntaxError (*).

(*) Also reproducible in Chakra, JSC, V8.
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.