* Processes the provided statement. * @param {(Directive | Statement | ModuleDeclaration)[]} statements statements
(statements)
| 4700 | * @param {(Directive | Statement | ModuleDeclaration)[]} statements statements |
| 4701 | */ |
| 4702 | detectMode(statements) { |
| 4703 | const statement = statements.length >= 1 ? statements[0] : undefined; |
| 4704 | if ( |
| 4705 | statement === undefined || |
| 4706 | statement.type !== "ExpressionStatement" || |
| 4707 | statement.expression.type !== "Literal" |
| 4708 | ) { |
| 4709 | return; |
| 4710 | } |
| 4711 | const value = /** @type {Literal} */ (statement.expression).value; |
| 4712 | if (value === "use strict") { |
| 4713 | this.scope.isStrict = true; |
| 4714 | } else if (value === "use asm") { |
| 4715 | this.scope.isAsmJs = true; |
| 4716 | } |
| 4717 | } |
| 4718 | |
| 4719 | /** |
| 4720 | * Processes the provided pattern. |
no outgoing calls
no test coverage detected