chore(coverage): remove arrow functions plugin from semantic check

This commit is contained in:
Boshen 2024-08-16 17:55:54 +08:00
parent f210cf7873
commit 7ecf0efd40
No known key found for this signature in database
GPG key ID: 67715A371E534061
4 changed files with 92 additions and 1583 deletions

View file

@ -69,12 +69,6 @@ previous scope ScopeId(0): ["K"]
current scope ScopeId(0): []
pass/swc-8243.tsx
semantic error: Bindings Mismatch:
previous scope ScopeId(0): ["Foo", "_jsx", "_jsxFileName"]
current scope ScopeId(0): ["Foo", "_jsx", "_jsxFileName", "_this"]
Bindings Mismatch:
previous scope ScopeId(1): ["_this", "props"]
current scope ScopeId(1): ["props"]
Symbols mismatch after transform
semantic error: Symbols mismatch after transform
ReferenceId mismatch after transform

View file

@ -2,223 +2,7 @@ commit: a1587416
semantic_test262 Summary:
AST Parsed : 46406/46406 (100.00%)
Positive Passed: 46346/46406 (99.87%)
built-ins/JSON/stringify/value-bigint-tojson-receiver.js
semantic error: Bindings Mismatch:
previous scope ScopeId(2): []
current scope ScopeId(2): ["_this"]
Bindings Mismatch:
previous scope ScopeId(3): ["_this"]
current scope ScopeId(3): []
Symbols mismatch after transform
ReferenceId mismatch after transform
built-ins/Object/keys/proxy-keys.js
semantic error: Bindings Mismatch:
previous scope ScopeId(5): []
current scope ScopeId(5): ["_this"]
Bindings Mismatch:
previous scope ScopeId(6): ["_this", "args"]
current scope ScopeId(6): ["args"]
Bindings Mismatch:
previous scope ScopeId(7): []
current scope ScopeId(7): ["_this2"]
Bindings Mismatch:
previous scope ScopeId(8): ["_this2", "args", "name"]
current scope ScopeId(8): ["args", "name"]
Symbols mismatch after transform
ReferenceId mismatch after transform
built-ins/Set/prototype/forEach/this-arg-explicit-cannot-override-lexical-this-arrow.js
semantic error: Bindings Mismatch:
previous scope ScopeId(0): ["counter", "s", "usurper"]
current scope ScopeId(0): ["_this", "counter", "s", "usurper"]
Bindings Mismatch:
previous scope ScopeId(1): ["_", "_this"]
current scope ScopeId(1): ["_"]
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/arrow-function/cannot-override-this-with-thisArg.js
semantic error: Bindings Mismatch:
previous scope ScopeId(0): ["calls", "usurper"]
current scope ScopeId(0): ["_this", "calls", "usurper"]
Bindings Mismatch:
previous scope ScopeId(1): ["_this", "value"]
current scope ScopeId(1): ["value"]
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/arrow-function/lexical-this.js
semantic error: Bindings Mismatch:
previous scope ScopeId(1): []
current scope ScopeId(1): ["_this"]
Bindings Mismatch:
previous scope ScopeId(2): ["_", "_this"]
current scope ScopeId(2): ["_"]
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/constructor-this-tdz-during-initializers.js
semantic error: Bindings Mismatch:
previous scope ScopeId(4): []
current scope ScopeId(4): ["_this"]
Bindings Mismatch:
previous scope ScopeId(5): ["_this"]
current scope ScopeId(5): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/private-field-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(2): ["arrowFunction"]
current scope ScopeId(2): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(3): ["_this"]
current scope ScopeId(3): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/private-getter-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/private-method-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/private-methods/prod-private-async-generator.js
semantic error: Bindings Mismatch:
previous scope ScopeId(5): ["ctorIter", "p"]
current scope ScopeId(5): ["_this", "ctorIter", "p"]
Bindings Mismatch:
previous scope ScopeId(6): ["_this"]
current scope ScopeId(6): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/private-methods/prod-private-async-method.js
semantic error: Bindings Mismatch:
previous scope ScopeId(5): []
current scope ScopeId(5): ["_this"]
Bindings Mismatch:
previous scope ScopeId(6): ["_this"]
current scope ScopeId(6): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/private-methods/prod-private-generator.js
semantic error: Bindings Mismatch:
previous scope ScopeId(5): ["res"]
current scope ScopeId(5): ["_this", "res"]
Bindings Mismatch:
previous scope ScopeId(6): ["_this"]
current scope ScopeId(6): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js
semantic error: Bindings Mismatch:
previous scope ScopeId(6): []
current scope ScopeId(6): ["_this"]
Bindings Mismatch:
previous scope ScopeId(7): ["_this"]
current scope ScopeId(7): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/private-methods/prod-private-method.js
semantic error: Bindings Mismatch:
previous scope ScopeId(5): []
current scope ScopeId(5): ["_this"]
Bindings Mismatch:
previous scope ScopeId(6): ["_this"]
current scope ScopeId(6): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/private-setter-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/static-field-init-this-inside-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(0): ["C"]
current scope ScopeId(0): ["C", "_this"]
Bindings Mismatch:
previous scope ScopeId(2): ["_this"]
current scope ScopeId(2): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/static-private-getter-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/static-private-method-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/class/elements/static-private-setter-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/tagged-template/call-expression-context-no-strict.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): []
current scope ScopeId(3): ["_this"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/expressions/tagged-template/call-expression-context-strict.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): []
current scope ScopeId(3): ["_this"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
Positive Passed: 46382/46406 (99.95%)
language/module-code/eval-rqstd-once.js
semantic error: Bindings Mismatch:
previous scope ScopeId(0): ["dflt1", "dflt2", "dflt3", "global", "ns1", "ns3"]
@ -363,153 +147,3 @@ previous scope ScopeId(0): ["resolved"]
current scope ScopeId(0): []
Symbols mismatch after transform
language/statements/class/elements/private-field-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(2): ["arrowFunction"]
current scope ScopeId(2): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(3): ["_this"]
current scope ScopeId(3): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/private-getter-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/private-method-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/private-methods/prod-private-async-generator.js
semantic error: Bindings Mismatch:
previous scope ScopeId(5): ["ctorIter", "p"]
current scope ScopeId(5): ["_this", "ctorIter", "p"]
Bindings Mismatch:
previous scope ScopeId(6): ["_this"]
current scope ScopeId(6): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/private-methods/prod-private-async-method.js
semantic error: Bindings Mismatch:
previous scope ScopeId(5): []
current scope ScopeId(5): ["_this"]
Bindings Mismatch:
previous scope ScopeId(6): ["_this"]
current scope ScopeId(6): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/private-methods/prod-private-generator.js
semantic error: Bindings Mismatch:
previous scope ScopeId(5): ["res"]
current scope ScopeId(5): ["_this", "res"]
Bindings Mismatch:
previous scope ScopeId(6): ["_this"]
current scope ScopeId(6): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/private-methods/prod-private-method-initialize-order.js
semantic error: Bindings Mismatch:
previous scope ScopeId(6): []
current scope ScopeId(6): ["_this"]
Bindings Mismatch:
previous scope ScopeId(7): ["_this"]
current scope ScopeId(7): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/private-methods/prod-private-method.js
semantic error: Bindings Mismatch:
previous scope ScopeId(5): []
current scope ScopeId(5): ["_this"]
Bindings Mismatch:
previous scope ScopeId(6): ["_this"]
current scope ScopeId(6): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/private-setter-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/privatefieldset-evaluation-order-3.js
semantic error: Bindings Mismatch:
previous scope ScopeId(4): ["init", "object"]
current scope ScopeId(4): ["_this", "init", "object"]
Bindings Mismatch:
previous scope ScopeId(5): ["_this"]
current scope ScopeId(5): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/static-field-init-this-inside-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(0): ["C"]
current scope ScopeId(0): ["C", "_this"]
Bindings Mismatch:
previous scope ScopeId(2): ["_this"]
current scope ScopeId(2): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/static-private-getter-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/static-private-method-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/elements/static-private-setter-access-on-inner-arrow-function.js
semantic error: Bindings Mismatch:
previous scope ScopeId(3): ["arrowFunction"]
current scope ScopeId(3): ["_this", "arrowFunction"]
Bindings Mismatch:
previous scope ScopeId(4): ["_this"]
current scope ScopeId(4): []
Symbols mismatch after transform
ReferenceId mismatch after transform
language/statements/class/subclass/class-definition-null-proto-this.js
semantic error: Bindings Mismatch:
previous scope ScopeId(2): []
current scope ScopeId(2): ["_this"]
Bindings Mismatch:
previous scope ScopeId(3): ["_this"]
current scope ScopeId(3): []
Symbols mismatch after transform
ReferenceId mismatch after transform

File diff suppressed because it is too large Load diff

View file

@ -2,8 +2,7 @@ use std::path::{Path, PathBuf};
use oxc_span::SourceType;
use oxc_transformer::{
ArrowFunctionsOptions, ES2015Options, ReactJsxRuntime, ReactOptions, TransformOptions,
TypeScriptOptions,
ES2015Options, ReactJsxRuntime, ReactOptions, TransformOptions, TypeScriptOptions,
};
use crate::{
@ -15,6 +14,20 @@ use crate::{
typescript::TypeScriptCase,
};
fn get_default_transformer_options() -> TransformOptions {
TransformOptions {
typescript: TypeScriptOptions::default(),
es2015: ES2015Options { arrow_function: None },
react: ReactOptions {
jsx_plugin: true,
jsx_self_plugin: true,
jsx_source_plugin: true,
..Default::default()
},
..Default::default()
}
}
/// Idempotency test
fn get_result(
source_text: &str,
@ -39,20 +52,6 @@ fn get_result(
TestResult::GenericError("semantic", messages)
}
fn get_default_transformer_options() -> TransformOptions {
TransformOptions {
typescript: TypeScriptOptions::default(),
es2015: ES2015Options { arrow_function: Some(ArrowFunctionsOptions::default()) },
react: ReactOptions {
jsx_plugin: true,
jsx_self_plugin: true,
jsx_source_plugin: true,
..Default::default()
},
..Default::default()
}
}
pub struct SemanticTest262Case {
base: Test262Case,
}