Closed Bug 490339 Opened 15 years ago Closed 15 years ago

Unexpected ReferenceError when using "new Function()"

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.1

People

(Reporter: soubok, Assigned: brendan)

References

Details

(Keywords: fixed1.9.1, Whiteboard: fixed-in-tracemonkey)

Attachments

(2 files)

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
Attached 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+
Attached 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: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: