Skip to content

Unexpected token error when parsing new dynamic import() with 2nd argument options #1276

@Nashorn

Description

@Nashorn

The new dynamic import() method now supports a new 2nd argument options {} argument. It fails on this line:

var _module = await import(cssPath, { with: { type: "css" } });

ERROR:
Unexpected token (839:54)

...import(cssPath, {...
at Function.processParsingError (/Users/smithjv/Development/arc-kernel/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/ASTParserFacade.ts:77:15)
at Function.parse (/Users/smithjv/Development/arc-kernel/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/ASTParserFacade.ts:43:49)
at o.parseCode (/Users/smithjv/Development/arc-kernel/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/JavaScriptObfuscator.ts:87:50)
at obfuscate (/Users/smithjv/Development/arc-kernel/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/JavaScriptObfuscator.ts:78:30)
at Function.obfuscate (/Users/smithjv/Development/arc-kernel/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/JavaScriptObfuscatorFacade.ts:16:56)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions