Skip to content

Commit e1e1dc4

Browse files
committed
Refactor: Extract FunctionID and builtin constants to function_id.rs
- Move `FunctionID` type alias and associated constants from `vm.rs` to `function_id.rs`. - Move `get_function_id` and `set_function_id` helper functions to the new module. - Register `function_id` module in `mod.rs`. - Import `crate::core::function_id::*` in `compiler.rs`, `value.rs`, and `vm.rs`.
1 parent 6ff786d commit e1e1dc4

5 files changed

Lines changed: 344 additions & 338 deletions

File tree

src/core/compiler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
use crate::core::function_id::*;
12
use crate::core::opcode::{Chunk, Opcode};
23
use crate::core::property_descriptor::{make_getter_key, make_setter_key};
34
use crate::core::statement::{
45
BinaryOp, CatchParamPattern, ClassMember, DestructuringElement, Expr, ImportSpecifier, ObjectDestructuringElement, Statement,
56
StatementKind,
67
};
7-
use crate::core::{BUILTIN_NEW_FUNCTION, JSError, Value};
8+
use crate::core::{JSError, Value};
89
use crate::raise_syntax_error;
910

1011
pub(crate) const INTERNAL_FOROF_HELPER: &str = "__forOfValues internal";

0 commit comments

Comments
 (0)