new Function() does not omit useless statements like normal JS parsing does

VERIFIED FIXED in mozilla1.8.1

Status

()

Core
JavaScript Engine
P4
minor
VERIFIED FIXED
12 years ago
11 years ago

People

(Reporter: Jesse Ruderman, Assigned: brendan)

Tracking

({testcase, verified1.8.1})

Trunk
mozilla1.8.1
testcase, verified1.8.1
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [schrep-181approval pending])

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
Using http://www.squarefree.com/shell/shell.html with a Mac trunk nightly:

> new Function("3")
function anonymous() { 3; }

> function(){3}
function () { }

I'd expect these two to have similar results.
(Assignee)

Updated

12 years ago
Assignee: general → brendan
OS: Mac OS X 10.4 → All
Priority: -- → P4
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.9beta
(Assignee)

Comment 1

12 years ago
Created attachment 235519 [details] [diff] [review]
fix

Safe fix to consolidate setting of JSFUN_INTERPRETED in FunctionBody, the common subroutine of FunctionDef and js_CompileFunctionBody that itself invokes the code generator (which needs to see this flag in order to do useless expression elim).

/be
Attachment #235519 - Flags: superreview?(shaver)
Attachment #235519 - Flags: review?(mrbkap)
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED
Target Milestone: mozilla1.9beta → mozilla1.8.1

Updated

12 years ago
Attachment #235519 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 2

12 years ago
Checking in jsfun.c;
/cvsroot/mozilla/js/src/jsfun.c,v  <--  jsfun.c
new revision: 3.163; previous revision: 3.162
done
Checking in jsparse.c;
/cvsroot/mozilla/js/src/jsparse.c,v  <--  jsparse.c
new revision: 3.211; previous revision: 3.210
done

Fixed on trunk.

/be
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
(Assignee)

Comment 3

12 years ago
Comment on attachment 235519 [details] [diff] [review]
fix

This is a safe fix that relieves the fuzzer from having to exlude a case we want to cover.

/be
Attachment #235519 - Flags: approval1.8.1?

Comment 4

12 years ago
Checking in regress-346892.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-346892.js,v  <--  regress-346892.js
initial revision: 1.1

Updated

12 years ago
Flags: in-testsuite+

Updated

12 years ago
Whiteboard: [awaiting shaver sr]
Comment on attachment 235519 [details] [diff] [review]
fix

sr=shaver.  It'd be good to get this in fx2 to avoid confusing inconsistency between forms.
Attachment #235519 - Flags: superreview?(shaver) → superreview+

Updated

12 years ago
Whiteboard: [awaiting shaver sr] → [schrep-181approval pending]

Comment 6

12 years ago
Comment on attachment 235519 [details] [diff] [review]
fix

a=schrep/beltnzer for drivers.
Attachment #235519 - Flags: approval1.8.1? → approval1.8.1+

Comment 7

12 years ago
verified fixed 1.9 20060827 windows/mac*/linux
Status: RESOLVED → VERIFIED
(Assignee)

Comment 8

12 years ago
Fixed on the 1.8 branch.

/be
Keywords: fixed1.8.1

Comment 9

11 years ago
verified fixed 1.8 20060828 windows/mac*/linux
Keywords: fixed1.8.1 → verified1.8.1
You need to log in before you can comment on or make changes to this bug.