()
| 8753 | } |
| 8754 | |
| 8755 | function parseProgramElements() { |
| 8756 | var sourceElement, sourceElements = [], token, directive, firstRestricted; |
| 8757 | |
| 8758 | while (index < length) { |
| 8759 | token = lookahead; |
| 8760 | if (token.type !== Token.StringLiteral) { |
| 8761 | break; |
| 8762 | } |
| 8763 | |
| 8764 | sourceElement = parseProgramElement(); |
| 8765 | sourceElements.push(sourceElement); |
| 8766 | if (sourceElement.expression.type !== Syntax.Literal) { |
| 8767 | // this is not directive |
| 8768 | break; |
| 8769 | } |
| 8770 | directive = source.slice(token.range[0] + 1, token.range[1] - 1); |
| 8771 | if (directive === 'use strict') { |
| 8772 | strict = true; |
| 8773 | if (firstRestricted) { |
| 8774 | throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); |
| 8775 | } |
| 8776 | } else { |
| 8777 | if (!firstRestricted && token.octal) { |
| 8778 | firstRestricted = token; |
| 8779 | } |
| 8780 | } |
| 8781 | } |
| 8782 | |
| 8783 | while (index < length) { |
| 8784 | sourceElement = parseProgramElement(); |
| 8785 | if (typeof sourceElement === 'undefined') { |
| 8786 | break; |
| 8787 | } |
| 8788 | sourceElements.push(sourceElement); |
| 8789 | } |
| 8790 | return sourceElements; |
| 8791 | } |
| 8792 | |
| 8793 | function parseProgram() { |
| 8794 | var body, marker = markerCreate(); |
no test coverage detected