(fnparam, prop, preserve)
| 20413 | // prop means that this identifier is that of an object property |
| 20414 | |
| 20415 | function optionalidentifier(fnparam, prop, preserve) { |
| 20416 | if (!state.tokens.next.identifier) { |
| 20417 | return; |
| 20418 | } |
| 20419 | |
| 20420 | if (!preserve) { |
| 20421 | advance(); |
| 20422 | } |
| 20423 | |
| 20424 | var curr = state.tokens.curr; |
| 20425 | var val = state.tokens.curr.value; |
| 20426 | |
| 20427 | if (!isReserved(curr)) { |
| 20428 | return val; |
| 20429 | } |
| 20430 | |
| 20431 | if (prop) { |
| 20432 | if (state.inES5()) { |
| 20433 | return val; |
| 20434 | } |
| 20435 | } |
| 20436 | |
| 20437 | if (fnparam && val === "undefined") { |
| 20438 | return val; |
| 20439 | } |
| 20440 | |
| 20441 | warning("W024", state.tokens.curr, state.tokens.curr.id); |
| 20442 | return val; |
| 20443 | } |
| 20444 | |
| 20445 | // fnparam means that this identifier is being defined as a function |
| 20446 | // argument |
no test coverage detected