"invalid string escape mask" messages are strange

RESOLVED FIXED

Status

()

Core
JavaScript Engine
--
minor
RESOLVED FIXED
11 years ago
6 years ago

People

(Reporter: Jesse Ruderman, Unassigned)

Tracking

({testcase})

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

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 obsolete attachment)

(Reporter)

Description

11 years ago
js> escape("foo", NaN)
typein:10: Error: invalid string escape mask 7

js> escape("foo", 1e90) 
typein:20: Error: invalid string escape mask 7fffffff

Comment 1

9 years ago
Created attachment 343701 [details] [diff] [review]
patch

This fixes the examples in comment 0 but not stuff like escape("", {}). I don't think it's worth the effort to store and root the original value of argv[1] to get these edge cases right?
Making digits static isn't related to this bug, just a quick way to save some bytes I noticed while looking at this code.
Attachment #343701 - Flags: review?(mrbkap)

Updated

9 years ago
Attachment #343701 - Attachment is obsolete: true
Attachment #343701 - Flags: review?(mrbkap)
js> escape("foo", NaN)
"foo"
js> escape("foo", 1e90)
"foo"
js> escape("foo", {})
"foo"

Should these be showing |%20foo%20|?
Flags: in-testsuite?
OS: Mac OS X → All
Hardware: PowerPC → All
Bug 666448 made escape() behavior not depend on a non-standard second argument, fixing this.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.