| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/share/nodejs/acorn-import-meta/ |
Upload File : |
"use strict"
const tt = require("acorn").tokTypes
const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g
const nextTokenIsDot = parser => {
skipWhiteSpace.lastIndex = parser.pos
let skip = skipWhiteSpace.exec(parser.input)
let next = parser.pos + skip[0].length
return parser.input.slice(next, next + 1) === "."
}
module.exports = function(Parser) {
return class extends Parser {
parseExprAtom(refDestructuringErrors) {
if (this.type !== tt._import || !nextTokenIsDot(this)) return super.parseExprAtom(refDestructuringErrors)
if (!this.options.allowImportExportEverywhere && !this.inModule) {
this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")
}
let node = this.startNode()
if (this.containsEsc) this.raiseRecoverable(this.start, "Escape sequence in keyword import")
node.meta = this.parseIdent(true)
this.expect(tt.dot)
node.property = this.parseIdent(true)
if (node.property.name !== "meta") {
this.raiseRecoverable(node.property.start, "The only valid meta property for import is import.meta")
}
if (this.containsEsc) {
this.raiseRecoverable(node.property.start, "\"meta\" in import.meta must not contain escape sequences")
}
return this.finishNode(node, "MetaProperty")
}
parseStatement(context, topLevel, exports) {
if (this.type !== tt._import || !nextTokenIsDot(this)) {
return super.parseStatement(context, topLevel, exports)
}
let node = this.startNode()
let expr = this.parseExpression()
return this.parseExpressionStatement(node, expr)
}
}
}