New issue
Advanced search Search tips

Issue 637167 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Exception message "*** is not a function" is not shown propery when the function name has non-ascii characters

Reported by hoge...@gmail.com, Aug 12 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.57 Safari/537.36

Steps to reproduce the problem:
1. Open console
2. Type
window["あいう"]()
3. Shows: 
Uncaught TypeError: window.ããã is not a function

What is the expected behavior?
Uncaught TypeError: window.あいう is not a function

What went wrong?
The code shows "TypeError: window.あいう is not a function" correctly.

bytes=function(s) {
   var r="";
   for(var i=0;i<s.length;i++) {
      r+="%"+(s.charCodeAt(i).toString(16)); 
   } 
   return decodeURIComponent(r); 
}
try { window["あいう"](); } catch (e) { bytes(e+"") ; }

It seems to be solved by check encoding of the error message.

Did this work before? No 

Chrome version: 53.0.2785.57  Channel: beta
OS Version: 6.3
Flash Version:
 
Components: -Blink Platform>DevTools
Components: -Platform>DevTools Blink>JavaScript
Status: Untriaged (was: Unconfirmed)
I think it's related to way how V8 create Error.message.
V8 team, please take a look.
Feel free to assign it back.
Cc: verwa...@chromium.org yangguo@chromium.org jgruber@chromium.org
Components: -Blink>JavaScript Blink>JavaScript>API
Status: Available (was: Untriaged)
Cc: -jgruber@chromium.org
Owner: jgruber@chromium.org
Status: Assigned (was: Available)
This is also present on Chrome 52. I'll take a look.

Repro for d8: {}["あいう"]()
The problem is in RenderCallSite. We grab a C string from CallPrinter::Print, which obviously doesn't work for unicode strings.
Status: Fixed (was: Assigned)
Fixed by https://codereview.chromium.org/2265073002/

Sign in to add a comment