From 3b9845d8913f72b6550808c5fda32870c86bd872 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 1 Jul 2023 21:43:17 -0400 Subject: fix(npm): handle more reserved words as cjs exports (#19672) Closes #19665 --- ext/node/analyze.rs | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'ext/node') diff --git a/ext/node/analyze.rs b/ext/node/analyze.rs index 2e5c2d15f..7d98f53db 100644 --- a/ext/node/analyze.rs +++ b/ext/node/analyze.rs @@ -366,9 +366,16 @@ fn esm_code_from_top_level_decls( static RESERVED_WORDS: Lazy> = Lazy::new(|| { HashSet::from([ + "abstract", + "arguments", + "async", + "await", + "boolean", "break", + "byte", "case", "catch", + "char", "class", "const", "continue", @@ -376,41 +383,56 @@ static RESERVED_WORDS: Lazy> = Lazy::new(|| { "default", "delete", "do", + "double", "else", + "enum", + "eval", "export", "extends", "false", + "final", "finally", + "float", "for", "function", + "get", + "goto", "if", + "implements", "import", "in", "instanceof", + "int", + "interface", + "let", + "long", + "native", "new", "null", + "package", + "private", + "protected", + "public", "return", + "set", + "short", + "static", "super", "switch", + "synchronized", "this", "throw", + "throws", + "transient", "true", "try", "typeof", "var", "void", + "volatile", "while", "with", "yield", - "let", - "enum", - "implements", - "interface", - "package", - "private", - "protected", - "public", - "static", ]) }); -- cgit v1.2.3