Closed
Bug 492150
Opened 15 years ago
Closed 15 years ago
Unexpected error occurred when javascript.options.strict is true
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla1.9.1
People
(Reporter: masayuki, Assigned: brendan)
References
Details
(Keywords: fixed1.9.1, regression, Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
2.16 KB,
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
This is reported to bugzilla-jp and contributors checks this bug. See the testcase: http://bugzilla.mozilla.gr.jp/attachment.cgi?id=4029 > <script type="application/x-javascript"> > > try { > throw 'foo'; > } > catch(e) { > var e = 'bar'; > } > document.write('OK'); > > </script> If the catch block defines var with defined name, the line throw an error *only* when javascript.options.strict is true. Sakai-san proposes a patch: http://bugzilla.mozilla.gr.jp/attachment.cgi?id=4030&action=diff He guesses that this is a mistake of bug 487209.
Flags: blocking1.9.1?
Comment 1•15 years ago
|
||
It's same as the patch already attached to bugzilla.mozilla.gr.jp, Nakano-san mentioned.
Attachment #376517 -
Flags: review?(brendan)
Assignee | ||
Comment 2•15 years ago
|
||
Comment on attachment 376517 [details] [diff] [review] Patch v1.0 Oops, sorry about this -- should have seen it. But let's get mrbkap's less biased review here. Thanks for the patch! /be
Attachment #376517 -
Flags: review?(brendan) → review?(mrbkap)
Assignee | ||
Comment 3•15 years ago
|
||
Easy fix, should take if not a blocker (this bug is a regression from 3.0.x). /be
Flags: wanted1.9.1?
Assignee | ||
Updated•15 years ago
|
Assignee: general → brendan
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.9.1
Comment 4•15 years ago
|
||
Comment on attachment 376517 [details] [diff] [review] Patch v1.0 This is the right fix, but I wonder if it might be better to common out the now non-trivial condition like: bool error = op == JSOP_DEFCONST || dn_kind == JSDefinition::CONST || (dn_kind == JSDefinition::LET && (stmt->type != STMT_CATCH || OuterLet(tc, stmt, atom))); if (JS_HAS_STRICT_OPTION(cx) ? op != JSOP_DEFVAR || dn_kind != JSDefinition::VAR : error) { name = js_AtomToPrintableString(cx, atom); if (!name || !js_ReportCompileErrorNumber(cx, TS(tc->compiler), pn, (!error) ? JSREPORT_WARNING | JSREPORT_STRICT : JSREPORT_ERROR, JSMSG_REDECLARED_VAR, JSDefinition::kindString(dn_kind), name)) { return JS_FALSE; } } I'll leave it up to brendan to have the final word on that.
Attachment #376517 -
Flags: review?(mrbkap) → review+
Updated•15 years ago
|
Flags: wanted1.9.1? → wanted1.9.1+
Updated•15 years ago
|
Flags: blocking1.9.1?
Assignee | ||
Comment 5•15 years ago
|
||
Attachment #376517 -
Attachment is obsolete: true
Attachment #376635 -
Flags: review+
Assignee | ||
Comment 6•15 years ago
|
||
Fixed: http://hg.mozilla.org/tracemonkey/rev/c8a11e7cde90 http://hg.mozilla.org/mozilla-central/rev/6ea54bfd7c28 /be
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: fixed-in-tracemonkey
Assignee | ||
Updated•15 years ago
|
Flags: in-testsuite?
Comment 7•15 years ago
|
||
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/821944c65a19
Keywords: fixed1.9.1
Updated•15 years ago
|
Summary: Unexpected error occurred when japascript.options.strict is true → Unexpected error occurred when javascript.options.strict is true
You need to log in
before you can comment on or make changes to this bug.
Description
•