mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
chore: 全仓 rustfmt 格式化归拢
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
//! `compiled_module_hash` 纳入绑定名(精确匹配避免错误复用)。
|
||||
|
||||
use oxide_parser::{
|
||||
ArrayExpressionElement, BindingPattern, ChainElement, Class, ClassElement, Declaration, ExportDefaultDeclarationKind,
|
||||
Expression, ForStatementInit, ForStatementLeft, Function, ImportDeclarationSpecifier, ModuleExportName,
|
||||
ObjectPropertyKind, PropertyKey, SimpleAssignmentTarget, Statement,
|
||||
ArrayExpressionElement, BindingPattern, ChainElement, Class, ClassElement, Declaration,
|
||||
ExportDefaultDeclarationKind, Expression, ForStatementInit, ForStatementLeft, Function, ImportDeclarationSpecifier,
|
||||
ModuleExportName, ObjectPropertyKind, PropertyKey, SimpleAssignmentTarget, Statement,
|
||||
};
|
||||
use std::hash::Hash;
|
||||
|
||||
|
||||
@@ -193,9 +193,7 @@ fn hash_for_statement(fr: &oxide_parser::ForStatement<'_>, h: &mut rustc_hash::F
|
||||
hash_statement(&fr.body, h, include_binding_names);
|
||||
}
|
||||
|
||||
fn hash_function_declaration(
|
||||
fd: &Function<'_>, h: &mut rustc_hash::FxHasher, include_binding_names: bool,
|
||||
) {
|
||||
fn hash_function_declaration(fd: &Function<'_>, h: &mut rustc_hash::FxHasher, include_binding_names: bool) {
|
||||
if include_binding_names {
|
||||
if let Some(id) = &fd.id {
|
||||
id.name.as_str().hash(h);
|
||||
|
||||
@@ -60,7 +60,11 @@ fn await_yield_plain_distinguished() {
|
||||
fn object_literals_distinguished() {
|
||||
assert_ne!(compiled("var o = { a: 1 }"), compiled("var o = { a: 2 }"));
|
||||
assert_ne!(compiled("var o = { a: 1 }"), compiled("var o = { b: 1 }"));
|
||||
assert_ne!(compiled("var o = { a: 1 }"), compiled("var o = { a: 1, b: 2 }"), "property count must be hashed");
|
||||
assert_ne!(
|
||||
compiled("var o = { a: 1 }"),
|
||||
compiled("var o = { a: 1, b: 2 }"),
|
||||
"property count must be hashed"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user