oxc/crates/oxc_semantic/tests/integration/modules.rs
Dunqing 27b2268a6c refactor(semantic)!: remove SymbolFlags::Export (#7414)
close: #7338
close: #7344

The `SymbolFlags::Export` is Initially used to solve `ExportSpecifier` that is not `IdentifierReference` that causes we cannot determine whether a Binding is not used everywhere by `Semantic`.

Since #3820 this problem is solved, so we don't need `SymbolFlags::Export` no longer. Also, removing this can help us easier to pass the `Semantic` check in `Transformer`
2024-11-22 09:17:37 +00:00

24 lines
639 B
Rust

use oxc_semantic::SymbolFlags;
use crate::util::SemanticTester;
#[test]
fn test_import_assignment() {
SemanticTester::ts("import Foo = require('./foo')")
.has_root_symbol("Foo")
.contains_flags(SymbolFlags::Import)
.test();
SemanticTester::ts("import { Foo } from './foo'; import Baz = Foo.Bar.Baz")
.has_root_symbol("Baz")
.contains_flags(SymbolFlags::Import)
.test();
}
#[test]
fn test_import_type() {
SemanticTester::ts(r#"import { type "<A>" as someA } from './a'; "#)
.has_root_symbol("someA")
.contains_flags(SymbolFlags::TypeImport)
.test();
}