MCPcopy Index your code
hub / github.com/Macuyiko/minecraft-python / optionalidentifier

Function optionalidentifier

ServerEditorWeb/ace/worker-javascript.js:3587–3619  ·  view source on GitHub ↗
(fnparam, prop, preserve, exported)

Source from the content-addressed store, hash-verified

3585 }
3586
3587 function optionalidentifier(fnparam, prop, preserve, exported) {
3588 if (!state.tokens.next.identifier) {
3589 return;
3590 }
3591
3592 if (!preserve) {
3593 advance();
3594 }
3595
3596 var curr = state.tokens.curr;
3597 var val = state.tokens.curr.value;
3598
3599 if (exported) {
3600 state.tokens.curr.exported = true;
3601 }
3602
3603 if (!isReserved(curr)) {
3604 return val;
3605 }
3606
3607 if (prop) {
3608 if (state.option.inES5()) {
3609 return val;
3610 }
3611 }
3612
3613 if (fnparam && val === "undefined") {
3614 return val;
3615 }
3616
3617 warning("W024", state.tokens.curr, state.tokens.curr.id);
3618 return val;
3619 }
3620 function identifier(fnparam, prop, exported) {
3621 var i = optionalidentifier(fnparam, prop, false, exported);
3622 if (i) {

Callers 3

identifierFunction · 0.85
propertyNameFunction · 0.85

Calls 3

advanceFunction · 0.85
isReservedFunction · 0.85
warningFunction · 0.85

Tested by

no test coverage detected