Skip to content

Commit

Permalink
Make deserialization faster (swc-project#324)
Browse files Browse the repository at this point in the history
swc_ecma_ast:
 - make deserialization faster
  • Loading branch information
kdy1 authored Mar 8, 2019
1 parent dd5f174 commit 248a53c
Show file tree
Hide file tree
Showing 9 changed files with 325 additions and 316 deletions.
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
required_version = "1.0.1"
required_version = "1.0.3"
use_field_init_shorthand = true
merge_imports = true
wrap_comments = true
Expand Down
1 change: 0 additions & 1 deletion ecmascript/ast/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use swc_common::Fold;
use swc_common::{ast_node, Span};

#[ast_node]
#[derive(Deserialize)]
pub struct Class {
#[serde(default)]
pub span: Span,
Expand Down
2 changes: 0 additions & 2 deletions ecmascript/ast/src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ use crate::{
stmt::BlockStmt,
typescript::{TsParamProp, TsTypeAnn, TsTypeParamDecl},
};
use serde::Deserialize;
use swc_common::{ast_node, Span};

/// Common parts of function and method.
#[ast_node]
#[derive(Deserialize)]
pub struct Function {
pub params: Vec<Pat>,

Expand Down
2 changes: 1 addition & 1 deletion ecmascript/parser/tests/test262.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn error_tests(tests: &mut Vec<TestDescAndFn>) -> Result<(), io::Error> {

const TYPES: &[&str] = &[
"fail", /* TODO
* "early" */
* "early" */
];

for err_type in TYPES {
Expand Down
3 changes: 1 addition & 2 deletions ecmascript/transforms/src/compat/es2015/parameters/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ test!(
{a6, a7} = {}) {}"#,
"function fn(a1, param, param1, a5, param2) {
var a2 = param === void 0 ? 4 : param, ref = param1 ? param1 : _throw(new TypeError(\"Cannot \
destructure 'undefined' or 'null'\")), a3 = ref.a3, a4 = ref.a4, ref1 = param2 === void 0 ? \
{
destructure 'undefined' or 'null'\")), a3 = ref.a3, a4 = ref.a4, ref1 = param2 === void 0 ? {
} : param2, ref2 = ref1 ? ref1 : _throw(new TypeError(\"Cannot destructure 'undefined' or \
'null'\")), a6 = ref2.a6, a7 = ref2.a7;
}
Expand Down
Loading

0 comments on commit 248a53c

Please sign in to comment.