From 03f9aba8732314d8c536dfd23f1fe286d4408e1b Mon Sep 17 00:00:00 2001 From: Dean Srebnik <49134864+load1n9@users.noreply.github.com> Date: Thu, 16 Jan 2025 15:33:50 -0500 Subject: [PATCH] chore: bump to oxc 0.46 (#537) --- Cargo.toml | 18 +++++++++--------- .../src/ecmascript/builtins/global_object.rs | 2 +- .../ecmascript/scripts_and_modules/script.rs | 2 +- nova_vm/src/engine/bytecode/instructions.rs | 2 +- tests/expectations.json | 10 ---------- tests/metrics.json | 6 +++--- 6 files changed, 15 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 554887e8..dcba7b5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,18 +30,18 @@ fast-float = "0.2.0" hashbrown = "0.15.2" num-bigint = "0.4.6" num-traits = "0.2.19" -oxc_allocator = "0.39.0" -oxc_ast = "0.39.0" -oxc_diagnostics = "0.39.0" +oxc_allocator = "0.46.0" +oxc_ast = "0.46.0" +oxc_diagnostics = "0.46.0" oxc-miette = { version = "1.0.2", features = ["fancy"] } -oxc_parser = "0.39.0" -oxc_semantic = "0.39.0" -oxc_span = "0.39.0" -oxc_syntax = "0.39.0" -oxc_ecmascript = "0.39.0" +oxc_parser = "0.46.0" +oxc_semantic = "0.46.0" +oxc_span = "0.46.0" +oxc_syntax = "0.46.0" +oxc_ecmascript = "0.46.0" rand = "0.8.5" ryu-js = "1.0.1" -sonic-rs = "0.3.16" +sonic-rs = "0.3.17" unicode-normalization = "0.1.24" wtf8 = "0.1" fast_float = "0.2.0" diff --git a/nova_vm/src/ecmascript/builtins/global_object.rs b/nova_vm/src/ecmascript/builtins/global_object.rs index c46d975f..24e6e251 100644 --- a/nova_vm/src/ecmascript/builtins/global_object.rs +++ b/nova_vm/src/ecmascript/builtins/global_object.rs @@ -245,7 +245,7 @@ pub fn perform_eval( // 12. If strictCaller is true, let strictEval be true. // 13. Else, let strictEval be ScriptIsStrict of script. - let strict_eval = script.is_strict(); + let strict_eval = strict_caller || script.has_use_strict_directive(); if strict_caller { debug_assert!(strict_eval); } diff --git a/nova_vm/src/ecmascript/scripts_and_modules/script.rs b/nova_vm/src/ecmascript/scripts_and_modules/script.rs index 99978552..e152a6bc 100644 --- a/nova_vm/src/ecmascript/scripts_and_modules/script.rs +++ b/nova_vm/src/ecmascript/scripts_and_modules/script.rs @@ -254,7 +254,7 @@ pub fn script_evaluation( mut gc: GcScope<'_, '_>, ) -> JsResult { let realm_id = script.realm; - let is_strict_mode = script.ecmascript_code.is_strict(); + let is_strict_mode = script.ecmascript_code.source_type.is_strict(); let source_code = script.source_code; let script = agent.heap.add_script(script); let realm = agent.get_realm(realm_id); diff --git a/nova_vm/src/engine/bytecode/instructions.rs b/nova_vm/src/engine/bytecode/instructions.rs index 3f8d10ca..2feeef1a 100644 --- a/nova_vm/src/engine/bytecode/instructions.rs +++ b/nova_vm/src/engine/bytecode/instructions.rs @@ -679,7 +679,7 @@ fn debug_print_expression(expr: &oxc_ast::ast::Expression) -> std::string::Strin oxc_ast::ast::Expression::NullLiteral(_) => "null".to_string(), oxc_ast::ast::Expression::NumericLiteral(l) => l.value.to_js_string(), oxc_ast::ast::Expression::BigIntLiteral(l) => l.raw.to_string(), - oxc_ast::ast::Expression::RegExpLiteral(l) => l.raw.to_string(), + oxc_ast::ast::Expression::RegExpLiteral(l) => l.raw.as_ref().unwrap().to_string(), oxc_ast::ast::Expression::StringLiteral(l) => l.raw.as_ref().unwrap().to_string(), oxc_ast::ast::Expression::TemplateLiteral(_) => "`...`".to_string(), _ => "[computed]".to_string(), diff --git a/tests/expectations.json b/tests/expectations.json index 1f4cba39..77e8ad93 100644 --- a/tests/expectations.json +++ b/tests/expectations.json @@ -15307,30 +15307,22 @@ "language/expressions/dynamic-import/reuse-namespace-object.js": "CRASH", "language/expressions/dynamic-import/syntax/valid/callexpression-arguments.js": "CRASH", "language/expressions/dynamic-import/syntax/valid/callexpression-templateliteral.js": "CRASH", - "language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-source-empty-str-is-valid-assign-expr.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-source-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-script-code-valid.js": "FAIL", - "language/expressions/dynamic-import/syntax/valid/nested-arrow-import-source-empty-str-is-valid-assign-expr.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-arrow-import-source-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-arrow-script-code-valid.js": "FAIL", - "language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-source-empty-str-is-valid-assign-expr.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-source-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-script-code-valid.js": "FAIL", - "language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-source-empty-str-is-valid-assign-expr.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-source-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-script-code-valid.js": "FAIL", - "language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-source-empty-str-is-valid-assign-expr.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-source-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-function-await-script-code-valid.js": "FAIL", - "language/expressions/dynamic-import/syntax/valid/nested-async-function-import-source-empty-str-is-valid-assign-expr.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-function-import-source-script-code-valid.js": "FAIL", - "language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-source-empty-str-is-valid-assign-expr.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-source-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-function-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-assertions-trailing-comma-first.js": "CRASH", "language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-assertions-trailing-comma-second.js": "CRASH", - "language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-source-empty-str-is-valid-assign-expr.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-source-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-script-code-valid.js": "CRASH", "language/expressions/dynamic-import/syntax/valid/nested-block-empty-str-is-valid-assign-expr.js": "CRASH", @@ -15378,9 +15370,7 @@ "language/expressions/dynamic-import/syntax/valid/nested-else-import-source-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-else-nested-imports.js": "CRASH", "language/expressions/dynamic-import/syntax/valid/nested-else-script-code-valid.js": "CRASH", - "language/expressions/dynamic-import/syntax/valid/nested-function-import-source-empty-str-is-valid-assign-expr.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-function-import-source-script-code-valid.js": "FAIL", - "language/expressions/dynamic-import/syntax/valid/nested-function-return-import-source-empty-str-is-valid-assign-expr.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-function-return-import-source-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-function-return-script-code-valid.js": "FAIL", "language/expressions/dynamic-import/syntax/valid/nested-function-script-code-valid.js": "FAIL", diff --git a/tests/metrics.json b/tests/metrics.json index b24c4d76..84da2a24 100644 --- a/tests/metrics.json +++ b/tests/metrics.json @@ -1,8 +1,8 @@ { "results": { - "crash": 14290, - "fail": 7293, - "pass": 23659, + "crash": 14359, + "fail": 7214, + "pass": 23669, "skip": 46, "timeout": 3, "unresolved": 0