Unexpected ReferenceError when using "new Function()"

RESOLVED FIXED in mozilla1.9.1

Status

()

defect
P1
major
RESOLVED FIXED
11 years ago
10 years ago

People

(Reporter: soubok, Assigned: brendan)

Tracking

({fixed1.9.1})

Trunk
mozilla1.9.1
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.9.1 +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(2 attachments)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.9) Gecko/2009040821 Firefox/3.0.9
Build Identifier: mozilla-central-ea128fc02710 				

The following script throw a ReferenceError when foo() is called.

function B( c ) {

	c();
}

var foo = new Function("\
	var a = {};\
	function C() {\
		return function() {\
			return a;\
		 }\
	}\
	B( C() );\
");

foo(); //  ReferenceError: a is not defined


Reproducible: Always
confirmed on 1.9.1 and later but not on 1.9.0 or earlier.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Version: unspecified → Trunk
Blocks: upvar2
Flags: blocking1.9.1?
Hardware: x86 → All
Posted patch fixSplinter Review
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #374814 - Flags: review?(mrbkap)
Priority: -- → P1
Target Milestone: --- → mozilla1.9.1
Flags: blocking1.9.1? → blocking1.9.1+
Attachment #374814 - Flags: review?(mrbkap) → review+
Posted file shell testcase
Fixed in tm:

http://hg.mozilla.org/tracemonkey/rev/8e72c21ac76e

/be
Whiteboard: fixed-in-tracemonkey
Fixed in m-c:

http://hg.mozilla.org/mozilla-central/rev/5e3157d1c28c

/be
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.