Closed Bug 435668 Opened 17 years ago Closed 17 years ago

"Function" constructor unexpected behavior

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 350268

People

(Reporter: antonglv, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 - Build ID: 2008040413 "Function" constructor doesn't report syntax errors in some cases, whereas regular "function" statement does. Reproducible: Always Steps to Reproduce: 1. Eval as regular js next code line new Function ("}") 2. Eval as regular js next code line function () {}} 3. Actual Results: On first step "Function" constructor doesn't report error, whereas on second step js engine report "syntax error". Expected Results: "Function" constructor should report "syntax error" on given string.
Pretty sure this is fixed in Firefox 3, or at least it was last time I tried.
Yup, sure is. From a nightly shell: js> new Function("}") typein:2: SyntaxError: syntax error: typein:2: } typein:2: ^
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Resolution: FIXED → DUPLICATE
You need to log in before you can comment on or make changes to this bug.