Closed Bug 395127 Opened 18 years ago Closed 18 years ago

uneval corrupts function having RegExp with unicode characters

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 375641

People

(Reporter: BijuMailList, Unassigned)

Details

I found it is OK to use unicode characters in RegExp with out escaping like \u9999. But if you uneval the function and re-eval it, it get corrupted. example:- function a() {return /ഷസ/;} becomes function a() {return /78/;} But if unicode characters in RegExp are escaped Like function c() {return /\u0D37\u0D38/;} this cont cause any problem you get eval(uneval()) as the same function c() {return /\u0D37\u0D38/;} ========= test case ====== s=[]; function a() {return /ഷസ/;} s.push(['return val of a ......', a()]); b = uneval(a) s.push(['uneval a .............',b]); eval(b); s.push(['return after re-eval..',a()]); function c() {return /\u0D37\u0D38/;} s.push(['uneval c .............',uneval(c)]); function d() {return "ഷസ";} s.push(['uneval a .............',uneval(d)]); s.join('\n'); ========= current output ====== Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a8pre) Gecko/2007090304 Minefield/3.0a8pre return val of a ......,/ഷസ/ uneval a .............,function a() {return /78/;} return after re-eval..,/78/ uneval c .............,function c() {return /\u0D37\u0D38/;} uneval a .............,function d() {return "\u0D37\u0D38";}
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.