RegExp literal after "if" block is considered a syntax error

VERIFIED FIXED

Status

()

Core
JavaScript Engine
VERIFIED FIXED
11 years ago
11 years ago

People

(Reporter: Jesse Ruderman, Unassigned)

Tracking

(Blocks: 1 bug, {testcase, verified1.8.1.1})

Trunk
PowerPC
Mac OS X
testcase, verified1.8.1.1
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

11 years ago
js> function() { if (x) { } (/a/gi.z); }
function () {
    if (x) {
    }
    /a/gi.z;
}

js> function() { if(x) { } /a/gi.z; }
syntax error

I think this is a bug in the compiler (rather than a bug in the decompiler), and the version without parens around the RegExp stuff should be accepted.
(Reporter)

Comment 1

11 years ago
Same thing happens with E4X literals, which perhaps isn't surprising.

js> function() { if(g) p; (<x/>.i) }    
function () {
    if (g) {
        p;
    }
    <x/>.i;
}

js> function () {
    if (g) {
        p;
    }
    <x/>.i;
typein:18: SyntaxError: syntax error:
(Reporter)

Comment 2

11 years ago
Fixed by "prep patch for plan A" in bug 346642.
Depends on: 346642
(Reporter)

Comment 3

11 years ago
Fixed on trunk because "prep patch for plan A, v9d" in bug 346642 was checked in.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED

Comment 4

11 years ago
Checking in e4x/Regress/regress-352649.js;
/cvsroot/mozilla/js/tests/e4x/Regress/regress-352649.js,v  <--  regress-352649.js
initial revision: 1.1
done
RCS file: /cvsroot/mozilla/js/tests/js1_5/Regress/regress-352649.js,v
done
Checking in js1_5/Regress/regress-352649.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-352649.js,v  <--  regress-352649.js
initial revision: 1.1
done
Flags: in-testsuite+

Comment 5

11 years ago
I am not sure the test is adequate as it does not fail on 1.8. Was this a trunk only regression?

verified fixed 1.9 20060919 windows/mac*/linux
Status: RESOLVED → VERIFIED

Comment 6

11 years ago
fixed by bug 346642 
verified fixed 20061203 windows/linux/mac*
Keywords: verified1.8.1.1
(Reporter)

Updated

11 years ago
No longer blocks: 349611
(Reporter)

Updated

11 years ago
Blocks: 349611
You need to log in before you can comment on or make changes to this bug.