Closed Bug 177314 Opened 22 years ago Closed 22 years ago

Rhino should allow '\400' to mean ' 0'

Categories

(Rhino Graveyard :: Core, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: user, Assigned: norrisboyd)

Details

Attachments

(1 file)

Although octal escapes in string literals are not part of Ecma 262 since the version 3, to support old scripts Rhino should handle them correctly. In particular, currently Rhino throws an error when evaluating '\400' == ' 0' js> '\400' == ' 0' js: "<stdin>", line 1: uncaught JavaScript exception: SyntaxError: octal escape too large (<stdin>; line 1) js: '\400' == ' 0' js: ....^ while SM gives true, which is what required by Ecma 262 version 1 and 2.
The patch also removes msg.oct.esc.too.large from the resources as it is no onger used
I commited the above patch, as it passes the test suite and gives true '\400' == ' 0'. The question is where to put a testcase for it?
Testcase added to JS testsuite: mozilla/js/tests/js1_5/LexicalConventions/regress-177314.js
Marking as fixed as the patch was commited.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Marking Verified FIXED. Before the patch, Rhino errored on the testcase as described above. Now, the testcase passes in both compiled and interpreted mode -
Status: RESOLVED → VERIFIED
Targeting as resolved against 1.5R4
Target Milestone: --- → 1.5R4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: