Array literals are toSourced rather than decompiled, creating bizarre error messages

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
8 years ago
5 years ago

People

(Reporter: jruderman, Unassigned)

Tracking

({regression, testcase})

Trunk
regression, testcase
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
Fryn brought this to my attention.

js> [].push(2).push(3)
TypeError: [2].push(2).push is not a function

js> !{}.__defineGetter__('',function(){}).__defineGetter__
TypeError: ({get '' () {}}).__defineGetter__("", function () {}) is undefined

Regression from tracemonkey changeset d4f969511664:
user:        Brian Hackett
date:        Thu Dec 30 08:07:43 2010 -0500
summary:     Don't generate INITPROP/INITELEM for singleton constant initializers, bug 577359.

I think this only happens for compile-and-go scripts, so maybe it was an expected and accepted result of the optimization in bug 577359?

Comment 1

8 years ago
Thanks, Jesse, for filing this.

Just to clarify:

js> [].push(2).push(3)
TypeError: [2].push(2).push is not a function

Expected: TypeError: [].push(2).push is not a function

js> !{}.__defineGetter__('',function(){}).__defineGetter__
TypeError: ({get '' () {}}).__defineGetter__("", function () {}) is undefined

Expected: TypeError: ({}).__defineGetter__("", function() {}) is undefined
js> [].push(2).push(3)
typein:1: TypeError: [].push(2).push is not a function

js> !{}.__defineGetter__('',function(){}).__defineGetter__
typein:2: TypeError: {}.__defineGetter__("", function () {}) is undefined
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Flags: in-testsuite?
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.