New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 2 users

Issue metadata

Status: Fixed
User never visited
Closed: Dec 2013
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Sign in to add a comment

devtool completion fails when property names contain unicode identifiers

Reported by, Mar 14 2013 Back to list

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.33 (KHTML, like Gecko) Chrome/27.0.1430.0 Safari/537.33

Steps to reproduce the problem:
1. a = { stop:1, steam:2, stuffâ: 8 };
2. type

What is the expected behavior?
completion should show 3 options, ie stop, steam and stuffâ

What went wrong?
only stop and steam are provided as completion options

Did this work before? N/A 

Chrome version: 27.0.1430.0  Channel: dev
OS Version: ubuntu 12.10 64bit

i've tried a bunch of non-english unicode chars including all of "ßàáâãäåæçèéêëìíîïðñòóôõöøùúû" and some greek letters, and none of them show in code completion. they all work correctly in code and this validator claims that they're valid in javascript identifiers
i failed to paste in the javascript validator url. it is

also, variables with unicode variables complete correctly ... so far the only cases that i've found that fail to complete are in property names
Status: Assigned

Comment 3 by Deleted ...@, Mar 14 2013

The unicode property names should work ok in firefox.
Labels: -Cr-Platform-DevTools -Pri-2 -OS-Linux Cr-Platform-DevTools-JavaScript Pri-3 OS-All
Made some research:
this worked long long ago, until timothy@ fixed some issues

Currently it's hard to fix properly since JavaScript doesn't have good API to work with unicode characters.

Changelist that timothy@ introduced narrows completion list and makes it too short. In firefox there's currently another problem - completion list is too narrow:

you can try following:

var a = {};
a["b+3"] = 1;

type "a."

firefox would complete your code to a.b+3, which is not what was supposed to be seen.

Lowering priority until we would have proper instruments to fix it.

Status: Started
the validator i linked above is powered by

which is MIT-licensed javascript and validates both properties and variables and indicates whether dot-notation is legal

Thanks, Seth, I've seen this code while was investigating your issue, but it's too complex, and we don't want 10Kb regexp in our codebase. We've decided to add simple heuristics:

This patch is landing right now.
Project Member

Comment 9 by, Dec 4 2013

The following revision refers to this bug:

r163185 | | 2013-12-04T18:07:53.414557Z

Changed paths:

[DevTools] Tuned console completion filter to allow non-ascii properties auto-completion.

BUG= 192730 

Review URL:
Status: Fixed

Comment 11 by, Dec 4 2013

For future reference, is the script that can be used to generate a JavaScript-compatible regular expression that matches valid identifiers. (It’s what powers the validator that was linked to earlier.) For ECMAScript 5.1 the regex is about 9 KB.
ok - thanks zvory. your heuristic works fine for my use case and i'd favor
being too liberal with showing properties than too strict (at worst, the
user needs to switch to bracket notation). i guess i'd show all properties
in dot notation completion - i'm using it as often for discovery (of the
properties) as for the actual completion (ie, it's a lot easier to type a
dot than for (var ii in nu) console.log(ii))

bracket notation shows all variables as valid completion, but not the valid
property names (as strings) so it's not much help for discovery

Sign in to add a comment