MCPcopy
hub / github.com/RubyLouvre/anu / identifier

Function identifier

test/babel.js:49995–50018  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49993 return text.charAt(at);
49994 },
49995 identifier = function identifier() {
49996
49997 // Parse an identifier. Normally, reserved words are disallowed here, but we
49998 // only use this for unquoted object keys, where reserved words are allowed,
49999 // so we don't check for those here. References:
50000 // - http://es5.github.com/#x7.6
50001 // - https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Variables
50002 // - http://docstore.mik.ua/orelly/webprog/jscript/ch02_07.htm
50003 // TODO Identifiers can have Unicode "letters" in them; add support for those.
50004
50005 var key = ch;
50006
50007 // Identifiers must start with a letter, _ or $.
50008 if (ch !== '_' && ch !== '$' && (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z')) {
50009 error("Bad identifier as unquoted key");
50010 }
50011
50012 // Subsequent characters can contain digits.
50013 while (next() && (ch === '_' || ch === '$' || ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch >= '0' && ch <= '9')) {
50014 key += ch;
50015 }
50016
50017 return key;
50018 },
50019 number = function number() {
50020
50021 // Parse a number value.

Callers 1

objectFunction · 0.85

Calls 2

errorFunction · 0.85
nextFunction · 0.70

Tested by

no test coverage detected