Comments (7)
Are U+200C and U+200D (from all the allowed characters) the only ones that fail in some clients at the moment?
from compat-table.
Not significant, but maybe:
var supportsZeroWidth = (function() {
try {
return eval('_\u200c\u200d = true');
} catch(e) { }
}());
from compat-table.
U+200C and U+200D are the only two characters that haven’t changed categories since Unicode 3.0 yet still fail in multiple browsers, even though they’re explicitly mentioned in the spec. (Btw, I fixed the U+200C/U+200D bugs in V8 and WebKit/JavaScriptCore now.)
It’s funny, really; most browsers that claimed full ES5-compliance months ago still fail on a simple var a\u200c\u200d
— only stable versions of IE9 and Firefox 10 get it right.
Other than those characters, the spec mentions the Unicode categories that are allowed in IdentifierStart
and IdentifierPart
— but that’s a separate issue. Of course, not all JavaScript engines have the same level of Unicode support yet. As the spec says:
ECMAScript implementations may recognize identifier characters defined in later editions of the Unicode Standard. If portability is a concern, programmers should only employ identifier characters defined in Unicode 3.0.
So no, there are lots of other identifiers that fail in multiple browsers at the moment, but these are one of the few characters that are explicitly mentioned in the ES5 spec (not deferred to a Unicode spec) yet they still fail. See the list of links to browser bugs in my post — only Firefox nightly seems to have full Unicode 6.1.0 support.
Nice simplification of the feature test!
from compat-table.
I see... So if we only consider Unicode 3.0, do implementations fare well with all the allowed characters?
from compat-table.
Other than the ZWJ and ZWNJ characters, I haven’t found a problem with non-Unicode 3.0 chars in any browser. As I tested some seriously crazy symbols, I doubt there are any. (I mostly tested browser implementations, though.)
The variable name validator might be useful when testing this further, as it will show a warning if a given identifier would not be allowed if the Unicode 3 database would’ve been used instead of the Unicode 6.1 database. E.g. http://mothereff.in/js-variables#%5Cu0cf1
from compat-table.
Yeah. I'm surprised test262 didn't catch that. Need to check if they test for it.
from compat-table.
Added. Thanks.
from compat-table.
Related Issues (20)
- ES6: In “Proxy, internal 'get' calls”, make the “RegExp.prototype.flags” test future-proof (failing because of `hasIndices`) HOT 1
- Can't open the site in China HOT 2
- "spread parameters after optional chaining" works in Chrome 91 HOT 6
- Can't find URL Standard HOT 6
- Would a PR making custom compat-tables easier be welcomed? HOT 5
- table horizontal scroll error
- Feature request: add structuredClone HOT 1
- Should Safari 15.4 have its own entry? HOT 1
- Feature Request - Browser Market Share HOT 4
- [spam]
- Deno uses V8; should not be painted yellow but green (also current Opera) HOT 4
- Add Bun HOT 4
- The verification of `RegExp.prototype.hasIndices` is incorrect HOT 4
- add new es2023 Array.prototype methods HOT 1
- Externalize results from tests
- Website down HOT 3
- The online test/result page is not available anymore HOT 2
- The "destructuring, parameters/duplicate identifier" test on es6 tab seems to be broken HOT 1
- Some of the subtests of "Proxy, internal 'get' calls" on the es6 tab seem to be broken HOT 5
- Some of the 'Set methods' tests are broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compat-table.