Last Comment Bug 355928 - "invalid string escape mask" messages are strange
: "invalid string escape mask" messages are strange
: testcase
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
-- minor (vote)
: ---
Assigned To: general
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2006-10-08 06:15 PDT by Jesse Ruderman
Modified: 2011-11-27 12:18 PST (History)
2 users (show)
ryanvm: in‑testsuite?
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (1.38 KB, patch)
2008-10-18 04:03 PDT, Aiko
no flags Details | Diff | Splinter Review

Description User image Jesse Ruderman 2006-10-08 06:15:02 PDT
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 User image Aiko 2008-10-18 04:03:31 PDT
Created attachment 343701 [details] [diff] [review]

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.
Comment 2 User image Ryan VanderMeulen [:RyanVM] 2011-11-27 11:46:43 PST
js> escape("foo", NaN)
js> escape("foo", 1e90)
js> escape("foo", {})

Should these be showing |%20foo%20|?
Comment 3 User image Jeff Walden [:Waldo] (remove +bmo to email) 2011-11-27 12:18:18 PST
Bug 666448 made escape() behavior not depend on a non-standard second argument, fixing this.

Note You need to log in before you can comment on or make changes to this bug.