Skip to content

Commit 2fd7abf

Browse files
committed
bump to fix be7913b7dab39a702199a86328980034e289953b
1 parent 127d0af commit 2fd7abf

File tree

3 files changed

+25
-30
lines changed

3 files changed

+25
-30
lines changed

Cargo.lock

Lines changed: 13 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ swc_html_minifier = { version = "35.0.0", default-features = false }
146146
swc_node_comments = { version = "16.0.0", default-features = false }
147147
swc_plugin_runner = { version = "21.0.0", default-features = false }
148148

149-
swc_experimental_ecma_ast = { version = "0.1.1", default-features = false }
150-
swc_experimental_ecma_parser = { version = "0.1.1", default-features = false }
151-
swc_experimental_ecma_semantic = { version = "0.1.1", default-features = false }
149+
swc_experimental_ecma_ast = { version = "0.3.1", default-features = false }
150+
swc_experimental_ecma_parser = { version = "0.3.1", default-features = false }
151+
swc_experimental_ecma_semantic = { version = "0.3.1", default-features = false }
152152

153153
rspack_dojang = { version = "0.1.11", default-features = false }
154154
tracy-client = { version = "=0.18.2", default-features = false, features = [

crates/rspack_core/src/concatenated_module.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ use swc_core::{
3030
common::{FileName, Spanned, SyntaxContext},
3131
ecma::visit::swc_ecma_ast,
3232
};
33-
use swc_experimental_ecma_ast::{Ast, ClassExpr, EsVersion, FromNodeId, Ident, NodeKind};
33+
use swc_experimental_ecma_ast::{Ast, ClassExpr, EsVersion, Ident, NodeIdTrait, NodeKind};
3434
use swc_experimental_ecma_parser::{EsSyntax, Parser, StringSource, Syntax};
35-
use swc_experimental_ecma_semantic::resolver::{Semantic, UNRESOLVED_SCOPE_ID, resolver};
35+
use swc_experimental_ecma_semantic::resolver::{Semantic, resolver};
3636
use swc_node_comments::SwcComments;
3737

3838
use crate::{
@@ -2353,10 +2353,10 @@ impl ConcatenatedModule {
23532353
let semantic = resolver(ret.root, ast);
23542354
let ids = collect_ident(ast, &semantic);
23552355

2356-
module_info.module_ctxt = SyntaxContext::from_u32(semantic.top_level_scope_id().raw());
2357-
module_info.global_ctxt = SyntaxContext::from_u32(UNRESOLVED_SCOPE_ID.raw());
2356+
module_info.module_ctxt = semantic.top_level_scope_id().to_ctxt();
2357+
module_info.global_ctxt = semantic.unresolved_scope_id().to_ctxt();
23582358
for ident in ids {
2359-
if semantic.node_scope(ident.id) == UNRESOLVED_SCOPE_ID {
2359+
if semantic.node_scope(ident.id).to_ctxt() == module_info.global_ctxt {
23602360
module_info
23612361
.global_scope_ident
23622362
.push(ident.to_legacy(ast, &semantic));
@@ -3229,7 +3229,7 @@ impl NewConcatenatedModuleIdent {
32293229
pub fn to_legacy(&self, ast: &Ast, semantic: &Semantic) -> ConcatenatedModuleIdent {
32303230
let span = self.id.span(ast);
32313231
let sym = Atom::new(ast.get_utf8(self.id.sym(ast)));
3232-
let ctxt = SyntaxContext::from_u32(semantic.node_scope(self.id).raw());
3232+
let ctxt = semantic.node_scope(self.id).to_ctxt();
32333233
ConcatenatedModuleIdent {
32343234
id: swc_ecma_ast::Ident::new(sym, span, ctxt),
32353235
is_class_expr_with_ident: self.is_class_expr_with_ident,
@@ -3241,14 +3241,14 @@ impl NewConcatenatedModuleIdent {
32413241
fn collect_ident(ast: &Ast, semantic: &Semantic) -> Vec<NewConcatenatedModuleIdent> {
32423242
let mut ids = Vec::new();
32433243
for (node_id, node) in ast.nodes() {
3244-
if node.kind == NodeKind::Ident {
3244+
if node.kind() == NodeKind::Ident {
32453245
let ident = Ident::from_node_id(node_id, ast);
32463246
let parent_id = semantic.parent_node(node_id);
3247-
let (shorthand, is_class_expr_with_ident) = match ast.get_node(parent_id).kind {
3247+
let (shorthand, is_class_expr_with_ident) = match ast.get_node(parent_id).kind() {
32483248
NodeKind::BindingIdent => {
32493249
let parent_id = semantic.parent_node(parent_id);
32503250
(
3251-
ast.get_node(parent_id).kind == NodeKind::AssignPatProp,
3251+
ast.get_node(parent_id).kind() == NodeKind::AssignPatProp,
32523252
false,
32533253
)
32543254
}

0 commit comments

Comments
 (0)