diff --git a/crates/oxc_ast/src/ast_impl/js.rs b/crates/oxc_ast/src/ast_impl/js.rs index 9c3309b37a82c1..d7a9eb49514787 100644 --- a/crates/oxc_ast/src/ast_impl/js.rs +++ b/crates/oxc_ast/src/ast_impl/js.rs @@ -952,6 +952,16 @@ impl<'a> BindingPatternKind<'a> { matches!(self, Self::BindingIdentifier(_)) } + #[allow(missing_docs)] + pub fn is_object_pattern(&self) -> bool { + matches!(self, Self::ObjectPattern(_)) + } + + #[allow(missing_docs)] + pub fn is_array_pattern(&self) -> bool { + matches!(self, Self::ArrayPattern(_)) + } + #[allow(missing_docs)] pub fn is_assignment_pattern(&self) -> bool { matches!(self, Self::AssignmentPattern(_)) diff --git a/crates/oxc_transformer/examples/transformer.rs b/crates/oxc_transformer/examples/transformer.rs index d6153ac8b645ea..ee37ca3b75dc6e 100644 --- a/crates/oxc_transformer/examples/transformer.rs +++ b/crates/oxc_transformer/examples/transformer.rs @@ -6,7 +6,7 @@ use oxc_codegen::CodeGenerator; use oxc_parser::Parser; use oxc_semantic::SemanticBuilder; use oxc_span::SourceType; -use oxc_transformer::{EnvOptions, TransformOptions, Transformer}; +use oxc_transformer::{EnvOptions, HelperLoaderMode, TransformOptions, Transformer}; use pico_args::Arguments; // Instruction: @@ -55,7 +55,7 @@ fn main() { let (symbols, scopes) = ret.semantic.into_symbol_table_and_scope_tree(); - let transform_options = if let Some(query) = &targets { + let mut transform_options = if let Some(query) = &targets { TransformOptions { env: EnvOptions::from_browserslist_query(query).unwrap(), ..TransformOptions::default() @@ -66,6 +66,8 @@ fn main() { TransformOptions::enable_all() }; + transform_options.helper_loader.mode = HelperLoaderMode::External; + let ret = Transformer::new(&allocator, path, &transform_options).build_with_symbols_and_scopes( symbols, scopes, diff --git a/crates/oxc_transformer/src/common/helper_loader.rs b/crates/oxc_transformer/src/common/helper_loader.rs index a4ba256f342eb8..323154111b11bc 100644 --- a/crates/oxc_transformer/src/common/helper_loader.rs +++ b/crates/oxc_transformer/src/common/helper_loader.rs @@ -143,6 +143,10 @@ pub enum Helper { AsyncToGenerator, ObjectSpread2, WrapAsyncGenerator, + Extends, + ObjectDestructuringEmpty, + ObjectWithoutProperties, + ToPropertyKey, } impl Helper { @@ -154,6 +158,10 @@ impl Helper { Self::AsyncToGenerator => "asyncToGenerator", Self::ObjectSpread2 => "objectSpread2", Self::WrapAsyncGenerator => "wrapAsyncGenerator", + Self::Extends => "extends", + Self::ObjectDestructuringEmpty => "objectDestructuringEmpty", + Self::ObjectWithoutProperties => "objectWithoutProperties", + Self::ToPropertyKey => "toPropertyKey", } } } diff --git a/crates/oxc_transformer/src/common/statement_injector.rs b/crates/oxc_transformer/src/common/statement_injector.rs index 6b8ea5cdf02c5b..dbcd1f8bf42d7b 100644 --- a/crates/oxc_transformer/src/common/statement_injector.rs +++ b/crates/oxc_transformer/src/common/statement_injector.rs @@ -79,7 +79,6 @@ impl<'a> StatementInjectorStore<'a> { // The non-trivial inner functions are not marked `#[inline]` - compiler can decide whether to inline or not. impl<'a> StatementInjectorStore<'a> { /// Add a statement to be inserted immediately before the target statement. - #[expect(dead_code)] #[inline] pub fn insert_before(&self, target: &A, stmt: Statement<'a>) { self.insert_before_address(target.address(), stmt); diff --git a/crates/oxc_transformer/src/compiler_assumptions.rs b/crates/oxc_transformer/src/compiler_assumptions.rs index 95ceb3e0117970..577b505d625dde 100644 --- a/crates/oxc_transformer/src/compiler_assumptions.rs +++ b/crates/oxc_transformer/src/compiler_assumptions.rs @@ -25,7 +25,6 @@ pub struct CompilerAssumptions { pub enumerable_module_meta: bool, #[serde(default)] - #[deprecated = "Not Implemented"] pub ignore_function_length: bool, #[serde(default)] @@ -60,7 +59,6 @@ pub struct CompilerAssumptions { pub no_uninitialized_private_field_access: bool, #[serde(default)] - #[deprecated = "Not Implemented"] pub object_rest_no_symbols: bool, #[serde(default)] diff --git a/crates/oxc_transformer/src/es2018/mod.rs b/crates/oxc_transformer/src/es2018/mod.rs index caeaf33a29e205..74af7d249bb76c 100644 --- a/crates/oxc_transformer/src/es2018/mod.rs +++ b/crates/oxc_transformer/src/es2018/mod.rs @@ -2,10 +2,11 @@ pub(crate) mod async_generator_functions; mod object_rest_spread; mod options; -use oxc_ast::ast::{Expression, ForOfStatement, Function, Statement}; +use oxc_ast::ast::*; use oxc_traverse::{Traverse, TraverseCtx}; use crate::context::TransformCtx; + use async_generator_functions::AsyncGeneratorFunctions; pub use object_rest_spread::{ObjectRestSpread, ObjectRestSpreadOptions}; pub use options::ES2018Options; @@ -32,6 +33,12 @@ impl<'a, 'ctx> ES2018<'a, 'ctx> { } impl<'a, 'ctx> Traverse<'a> for ES2018<'a, 'ctx> { + fn exit_program(&mut self, program: &mut oxc_ast::ast::Program<'a>, ctx: &mut TraverseCtx<'a>) { + if self.options.object_rest_spread.is_some() { + self.object_rest_spread.exit_program(program, ctx); + } + } + fn enter_expression(&mut self, expr: &mut Expression<'a>, ctx: &mut TraverseCtx<'a>) { if self.options.object_rest_spread.is_some() { self.object_rest_spread.enter_expression(expr, ctx); @@ -56,9 +63,34 @@ impl<'a, 'ctx> Traverse<'a> for ES2018<'a, 'ctx> { } } - fn enter_for_of_statement(&mut self, node: &mut ForOfStatement<'a>, ctx: &mut TraverseCtx<'a>) { + fn enter_for_in_statement(&mut self, stmt: &mut ForInStatement<'a>, ctx: &mut TraverseCtx<'a>) { + if self.options.object_rest_spread.is_some() { + self.object_rest_spread.enter_for_in_statement(stmt, ctx); + } + } + + fn enter_for_of_statement(&mut self, stmt: &mut ForOfStatement<'a>, ctx: &mut TraverseCtx<'a>) { if self.options.async_generator_functions { - self.async_generator_functions.enter_for_of_statement(node, ctx); + self.async_generator_functions.enter_for_of_statement(stmt, ctx); + } + if self.options.object_rest_spread.is_some() { + self.object_rest_spread.enter_for_of_statement(stmt, ctx); + } + } + + fn enter_arrow_function_expression( + &mut self, + arrow: &mut ArrowFunctionExpression<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + if self.options.object_rest_spread.is_some() { + self.object_rest_spread.enter_arrow_function_expression(arrow, ctx); + } + } + + fn enter_function(&mut self, func: &mut Function<'a>, ctx: &mut TraverseCtx<'a>) { + if self.options.object_rest_spread.is_some() { + self.object_rest_spread.enter_function(func, ctx); } } @@ -67,4 +99,20 @@ impl<'a, 'ctx> Traverse<'a> for ES2018<'a, 'ctx> { self.async_generator_functions.exit_function(node, ctx); } } + + fn enter_variable_declaration( + &mut self, + decl: &mut VariableDeclaration<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + if self.options.object_rest_spread.is_some() { + self.object_rest_spread.enter_variable_declaration(decl, ctx); + } + } + + fn enter_catch_clause(&mut self, clause: &mut CatchClause<'a>, ctx: &mut TraverseCtx<'a>) { + if self.options.object_rest_spread.is_some() { + self.object_rest_spread.enter_catch_clause(clause, ctx); + } + } } diff --git a/crates/oxc_transformer/src/es2018/object_rest_spread.rs b/crates/oxc_transformer/src/es2018/object_rest_spread.rs index 39963df9871864..8a2c1c283e4371 100644 --- a/crates/oxc_transformer/src/es2018/object_rest_spread.rs +++ b/crates/oxc_transformer/src/es2018/object_rest_spread.rs @@ -23,127 +23,1134 @@ //! Implementation based on [@babel/plugin-transform-object-rest-spread](https://babeljs.io/docs/babel-plugin-transform-object-rest-spread). //! //! ## References: +//! //! * Babel plugin implementation: //! * Object rest/spread TC39 proposal: +use std::mem; + use serde::Deserialize; +use oxc_allocator::{CloneIn, GetAddress, Vec as ArenaVec}; use oxc_ast::{ast::*, NONE}; -use oxc_semantic::{ReferenceFlags, SymbolId}; -use oxc_span::SPAN; -use oxc_traverse::{Traverse, TraverseCtx}; +use oxc_diagnostics::OxcDiagnostic; +use oxc_ecmascript::{BoundNames, ToJsString}; +use oxc_semantic::{IsGlobalReference, ReferenceFlags, ScopeFlags, ScopeId, SymbolFlags}; +use oxc_span::{GetSpan, SPAN}; +use oxc_traverse::{Ancestor, MaybeBoundIdentifier, Traverse, TraverseCtx}; use crate::{common::helper_loader::Helper, TransformCtx}; #[derive(Debug, Default, Clone, Copy, Deserialize)] #[serde(default, rename_all = "camelCase")] pub struct ObjectRestSpreadOptions { - #[serde(alias = "loose")] - pub(crate) set_spread_properties: bool, + pub loose: bool, - pub(crate) use_built_ins: bool, + pub use_built_ins: bool, } pub struct ObjectRestSpread<'a, 'ctx> { ctx: &'ctx TransformCtx<'a>, + options: ObjectRestSpreadOptions, + + excluded_variable_declarators: Vec>, } impl<'a, 'ctx> ObjectRestSpread<'a, 'ctx> { pub fn new(options: ObjectRestSpreadOptions, ctx: &'ctx TransformCtx<'a>) -> Self { - Self { ctx, options } + if options.loose { + ctx.error(OxcDiagnostic::error( + "Option `loose` is not implemented for object-rest-spread.", + )); + } + if options.use_built_ins { + ctx.error(OxcDiagnostic::error( + "Option `useBuiltIns` is not implemented for object-rest-spread.", + )); + } + if ctx.assumptions.object_rest_no_symbols { + ctx.error(OxcDiagnostic::error( + "Compiler assumption `objectRestNoSymbols` is not implemented for object-rest-spread.", + )); + } + if ctx.assumptions.ignore_function_length { + ctx.error(OxcDiagnostic::error( + "Compiler assumption `ignoreFunctionLength` is not implemented for object-rest-spread.", + )); + } + Self { ctx, options, excluded_variable_declarators: vec![] } } } impl<'a, 'ctx> Traverse<'a> for ObjectRestSpread<'a, 'ctx> { + // For excluded keys when destructuring inside a function. + // `function foo() { ({a, ...b} = c) }` -> `const _excluded = ["a"]; function foo() { ... }` + fn exit_program(&mut self, _node: &mut Program<'a>, ctx: &mut TraverseCtx<'a>) { + if !self.excluded_variable_declarators.is_empty() { + let declarators = ctx.ast.vec_from_iter(self.excluded_variable_declarators.drain(..)); + let kind = VariableDeclarationKind::Const; + let declaration = ctx.ast.alloc_variable_declaration(SPAN, kind, declarators, false); + let statement = Statement::VariableDeclaration(declaration); + self.ctx.top_level_statements.insert_statement(statement); + } + } + + // `({ x, ..y })`. + // `({ x, ..y } = foo)`. + // `([{ x, ..y }] = foo)`. fn enter_expression(&mut self, expr: &mut Expression<'a>, ctx: &mut TraverseCtx<'a>) { - self.transform_object_expression(expr, ctx); + Self::transform_object_expression(self.options, expr, self.ctx, ctx); + self.transform_assignment_expression(expr, ctx); + } + + // `(...x) => {}`. + fn enter_arrow_function_expression( + &mut self, + arrow: &mut ArrowFunctionExpression<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + Self::transform_arrow(arrow, ctx); + } + + // `function foo({...x}) {}`. + fn enter_function(&mut self, func: &mut Function<'a>, ctx: &mut TraverseCtx<'a>) { + Self::transform_function(func, ctx); + } + + // `let { x, ..y } = foo`. + // `let [{ x, ..y }] = foo` + // Includes `for (var {...x} = 1;;);` + fn enter_variable_declaration( + &mut self, + decl: &mut VariableDeclaration<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + self.transform_variable_declaration(decl, ctx); + } + + // Transform `try {} catch (...x) {}`. + fn enter_catch_clause(&mut self, clause: &mut CatchClause<'a>, ctx: &mut TraverseCtx<'a>) { + Self::transform_catch_clause(clause, ctx); + } + + // `for ({...x} in []);` `for ({...x} of []);` + // `for ([{...x}] in []);` `for ([{...x}] of []);` + fn enter_for_in_statement(&mut self, stmt: &mut ForInStatement<'a>, ctx: &mut TraverseCtx<'a>) { + let scope_id = stmt.scope_id(); + Self::transform_for_statement_left(scope_id, &mut stmt.left, &mut stmt.body, ctx); + } + + // `for ({...x} in []);` `for ({...x} of []);` + // `for ([{...x}] in []);` `for ([{...x}] of []);` + fn enter_for_of_statement(&mut self, stmt: &mut ForOfStatement<'a>, ctx: &mut TraverseCtx<'a>) { + let scope_id = stmt.scope_id(); + Self::transform_for_statement_left(scope_id, &mut stmt.left, &mut stmt.body, ctx); } } impl<'a, 'ctx> ObjectRestSpread<'a, 'ctx> { - fn transform_object_expression( + // Transform `({ x, ..y } = foo)`. + // Transform `([{ x, ..y }] = foo)`. + fn transform_assignment_expression( &mut self, expr: &mut Expression<'a>, ctx: &mut TraverseCtx<'a>, ) { - let Expression::ObjectExpression(obj_expr) = expr else { + let Expression::AssignmentExpression(assign_expr) = expr else { + return; + }; + // Allow `{...x} = {}` and `[{...x}] = []`. + if !Self::has_nested_target_rest(&assign_expr.left) { return; }; - if obj_expr - .properties - .iter() - .all(|prop| matches!(prop, ObjectPropertyKind::ObjectProperty(..))) + // If not an top `({ ...y })`, walk the pattern and create references for all the objects with a rest. + if !matches!(&assign_expr.left, AssignmentTarget::ObjectAssignmentTarget(t) if t.rest.is_some()) { + self.walk_and_replace_nested_object_target(expr, ctx); return; } - // collect `y` and `z` from `{ ...x, y, z }` - let mut obj_prop_list = ctx.ast.vec(); - while obj_expr - .properties - .last() - .map_or(false, |prop| matches!(prop, ObjectPropertyKind::ObjectProperty(..))) - { - let prop = obj_expr.properties.pop().unwrap(); - obj_prop_list.push(prop); + let kind = VariableDeclarationKind::Var; + let symbol_flags = kind_to_symbol_flags(kind); + let scope_id = ctx.current_scope_id(); + let mut reference_builder = + ReferenceBuilder::new(&mut assign_expr.right, symbol_flags, scope_id, true, ctx); + let state = State::new(kind, symbol_flags, scope_id); + + let mut new_decls = vec![]; + + if let Some(id) = reference_builder.binding.take() { + new_decls.push(ctx.ast.variable_declarator(SPAN, state.kind, id, None, false)); + } + + let data = Self::walk_assignment_target(&mut assign_expr.left, &mut new_decls, state, ctx); + + // Insert `var _foo` before this statement. + if !new_decls.is_empty() { + for node in ctx.ancestors() { + if let Ancestor::ExpressionStatementExpression(decl) = node { + let kind = VariableDeclarationKind::Var; + let declaration = ctx.ast.alloc_variable_declaration( + SPAN, + kind, + ctx.ast.vec_from_iter(new_decls), + false, + ); + let statement = Statement::VariableDeclaration(declaration); + self.ctx.statement_injector.insert_before(&decl.address(), statement); + break; + } + } + } + + // Make an sequence expression. + let mut expressions = ctx.ast.vec(); + let op = AssignmentOperator::Assign; + + // Insert `_foo = rhs` + if let Some(expr) = reference_builder.expr.take() { + expressions.push(ctx.ast.expression_assignment( + SPAN, + op, + reference_builder.maybe_bound_identifier.create_read_write_target(ctx), + expr, + )); + } + + // Insert `{} = _foo` + expressions.push(ctx.ast.expression_assignment( + SPAN, + op, + ctx.ast.move_assignment_target(&mut assign_expr.left), + reference_builder.create_read_expression(ctx), + )); + + // Insert all `rest = _extends({}, (_objectDestructuringEmpty(_foo), _foo))` + for datum in data { + let (lhs, rhs) = datum.get_lhs_rhs( + &mut reference_builder, + &mut self.excluded_variable_declarators, + self.ctx, + ctx, + ); + if let BindingPatternOrAssignmentTarget::AssignmentTarget(lhs) = lhs { + if let AssignmentTarget::AssignmentTargetIdentifier(ident) = &lhs { + ctx.symbols_mut() + .get_reference_mut(ident.reference_id()) + .flags_mut() + .insert(ReferenceFlags::Read); + } + expressions.push(ctx.ast.expression_assignment(SPAN, op, lhs, rhs)); + } + } + + // Insert final read `_foo`. + // TODO: remove this if the assignment is not a read reference. + // e.g. remove for `({ a2, ...b2 } = c2)`, keep `(x, ({ a2, ...b2 } = c2)`. + expressions.push(reference_builder.create_read_expression(ctx)); + + *expr = ctx.ast.expression_sequence(assign_expr.span, expressions); + } + + fn walk_assignment_target( + target: &mut AssignmentTarget<'a>, + new_decls: &mut Vec>, + state: State, + ctx: &mut TraverseCtx<'a>, + ) -> Vec> { + match target { + AssignmentTarget::ObjectAssignmentTarget(t) => { + let mut data = vec![]; + for prop in t.properties.iter_mut() { + if let AssignmentTargetProperty::AssignmentTargetPropertyProperty(p) = prop { + data.extend(match &mut p.binding { + AssignmentTargetMaybeDefault::AssignmentTargetWithDefault(t) => { + Self::walk_assignment_target(&mut t.binding, new_decls, state, ctx) + } + _ => Self::walk_assignment_target( + p.binding.to_assignment_target_mut(), + new_decls, + state, + ctx, + ), + }); + } + } + if let Some(datum) = + Self::transform_object_assignment_target(t, new_decls, state, ctx) + { + data.push(datum); + } + data + } + _ => vec![], } + } - let Some(ObjectPropertyKind::SpreadProperty(mut spread_prop)) = obj_expr.properties.pop() - else { + fn transform_object_assignment_target( + object_assignment_target: &mut ObjectAssignmentTarget<'a>, + new_decls: &mut Vec>, + state: State, + ctx: &mut TraverseCtx<'a>, + ) -> Option> { + let rest = object_assignment_target.rest.take()?; + let mut all_primitives = true; + let keys = + ctx.ast.vec_from_iter(object_assignment_target.properties.iter_mut().filter_map(|e| { + match e { + AssignmentTargetProperty::AssignmentTargetPropertyIdentifier(ident) => { + let name = ident.binding.name.clone(); + let expr = ctx.ast.expression_string_literal(SPAN, name); + Some(ArrayExpressionElement::from(expr)) + } + AssignmentTargetProperty::AssignmentTargetPropertyProperty(p) => { + Self::transform_property_key( + &mut p.name, + new_decls, + &mut all_primitives, + state, + ctx, + ) + } + } + })); + Some(SpreadPair { + lhs: BindingPatternOrAssignmentTarget::AssignmentTarget(rest.target), + keys, + has_no_properties: object_assignment_target.is_empty(), + all_primitives, + }) + } + + fn has_nested_target_rest(target: &AssignmentTarget<'a>) -> bool { + match target { + AssignmentTarget::ObjectAssignmentTarget(t) => { + t.rest.is_some() + || t.properties.iter().any(|p| match p { + AssignmentTargetProperty::AssignmentTargetPropertyIdentifier(_) => false, + AssignmentTargetProperty::AssignmentTargetPropertyProperty(p) => { + match &p.binding { + AssignmentTargetMaybeDefault::AssignmentTargetWithDefault(t) => { + Self::has_nested_target_rest(&t.binding) + } + _ => Self::has_nested_target_rest(p.binding.to_assignment_target()), + } + } + }) + } + AssignmentTarget::ArrayAssignmentTarget(t) => { + t.elements.iter().flatten().any(|e| match e { + AssignmentTargetMaybeDefault::AssignmentTargetWithDefault(t) => { + Self::has_nested_target_rest(&t.binding) + } + _ => Self::has_nested_target_rest(e.to_assignment_target()), + }) || t.rest.as_ref().is_some_and(|r| Self::has_nested_target_rest(&r.target)) + } + _ => false, + } + } + + fn walk_and_replace_nested_object_target( + &mut self, + expr: &mut Expression<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + let Expression::AssignmentExpression(assign_expr) = expr else { + return; + }; + let mut decls = vec![]; + let mut exprs = vec![]; + Self::recursive_walk_assignment_target(&mut assign_expr.left, &mut decls, &mut exprs, ctx); + for node in ctx.ancestors() { + if let Ancestor::ExpressionStatementExpression(decl) = node { + let kind = VariableDeclarationKind::Var; + let declaration = ctx.ast.alloc_variable_declaration( + SPAN, + kind, + ctx.ast.vec_from_iter(decls), + false, + ); + let statement = Statement::VariableDeclaration(declaration); + self.ctx.statement_injector.insert_before(&decl.address(), statement); + break; + } + } + let mut expressions = ctx.ast.vec1(ctx.ast.move_expression(expr)); + expressions.extend(exprs); + *expr = ctx.ast.expression_sequence(SPAN, expressions); + } + + fn recursive_walk_assignment_target( + pat: &mut AssignmentTarget<'a>, + decls: &mut Vec>, + exprs: &mut Vec>, + ctx: &mut TraverseCtx<'a>, + ) { + match pat { + AssignmentTarget::ArrayAssignmentTarget(t) => { + for e in t.elements.iter_mut().flatten() { + Self::recursive_walk_assignment_target_maybe_default(e, decls, exprs, ctx); + } + } + AssignmentTarget::ObjectAssignmentTarget(t) => { + for p in t.properties.iter_mut() { + if let AssignmentTargetProperty::AssignmentTargetPropertyProperty(e) = p { + Self::recursive_walk_assignment_target_maybe_default( + &mut e.binding, + decls, + exprs, + ctx, + ); + } + } + if t.rest.is_none() { + return; + } + let scope_id = ctx.scoping.current_scope_id(); + let flags = SymbolFlags::FunctionScopedVariable; + let bound_identifier = ctx.generate_uid("ref", scope_id, flags); + let id = bound_identifier.create_binding_pattern(ctx); + let kind = VariableDeclarationKind::Var; + decls.push(ctx.ast.variable_declarator(SPAN, kind, id, None, false)); + exprs.push(ctx.ast.expression_assignment( + SPAN, + AssignmentOperator::Assign, + ctx.ast.move_assignment_target(pat), + bound_identifier.create_read_expression(ctx), + )); + *pat = bound_identifier.create_spanned_write_target(SPAN, ctx); + } + _ => {} + } + } + + fn recursive_walk_assignment_target_maybe_default( + target: &mut AssignmentTargetMaybeDefault<'a>, + decls: &mut Vec>, + exprs: &mut Vec>, + ctx: &mut TraverseCtx<'a>, + ) { + match target { + AssignmentTargetMaybeDefault::AssignmentTargetWithDefault(d) => { + Self::recursive_walk_assignment_target(&mut d.binding, decls, exprs, ctx); + } + _ => Self::recursive_walk_assignment_target( + target.to_assignment_target_mut(), + decls, + exprs, + ctx, + ), + } + } +} + +impl<'a, 'ctx> ObjectRestSpread<'a, 'ctx> { + // Transform `({ x, ..y })`. + // `pub` for jsx spread. + pub fn transform_object_expression( + _options: ObjectRestSpreadOptions, + expr: &mut Expression<'a>, + transform_ctx: &'ctx TransformCtx<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + let Expression::ObjectExpression(obj_expr) = expr else { + return; + }; + + if obj_expr.properties.iter().all(|prop| !prop.is_spread()) { + return; + } + + let mut call_expr: Option> = None; + let mut props = vec![]; + + for prop in obj_expr.properties.drain(..) { + if let ObjectPropertyKind::SpreadProperty(spread_prop) = prop { + Self::make_object_spread(&mut call_expr, &mut props, transform_ctx, ctx); + let arg = ctx.ast.move_expression(&mut spread_prop.unbox().argument); + call_expr.as_mut().unwrap().arguments.push(Argument::from(arg)); + } else { + props.push(prop); + } + } + + if !props.is_empty() { + Self::make_object_spread(&mut call_expr, &mut props, transform_ctx, ctx); + } + + *expr = Expression::CallExpression(ctx.ast.alloc(call_expr.unwrap())); + } + + fn make_object_spread( + expr: &mut Option>, + props: &mut Vec>, + transform_ctx: &'ctx TransformCtx<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + let had_props = !props.is_empty(); + let obj = ctx.ast.expression_object(SPAN, ctx.ast.vec_from_iter(props.drain(..)), None); + let new_expr = if let Some(call_expr) = expr.take() { + let callee = transform_ctx.helper_load(Helper::ObjectSpread2, ctx); + let arg = Expression::CallExpression(ctx.ast.alloc(call_expr)); + let mut arguments = ctx.ast.vec1(Argument::from(arg)); + if had_props { + let empty_object = ctx.ast.expression_object(SPAN, ctx.ast.vec(), None); + arguments.push(Argument::from(empty_object)); + arguments.push(Argument::from(obj)); + } + ctx.ast.call_expression(SPAN, callee, NONE, arguments, false) + } else { + let callee = transform_ctx.helper_load(Helper::ObjectSpread2, ctx); + let arguments = ctx.ast.vec1(Argument::from(obj)); + ctx.ast.call_expression(SPAN, callee, NONE, arguments, false) + }; + expr.replace(new_expr); + } +} + +impl<'a, 'ctx> ObjectRestSpread<'a, 'ctx> { + // Transform `function foo({...x}) {}`. + fn transform_function(func: &mut Function<'a>, ctx: &mut TraverseCtx<'a>) { + let scope_id = func.scope_id(); + let Some(body) = func.body.as_mut() else { return }; + for param in func.params.items.iter_mut() { + if Self::has_nested_object_rest(¶m.pattern) { + Self::replace_rest_element( + VariableDeclarationKind::Var, + &mut param.pattern, + &mut body.statements, + scope_id, + ctx, + ); + } + } + } + + // Transform `(...x) => {}`. + fn transform_arrow(arrow: &mut ArrowFunctionExpression<'a>, ctx: &mut TraverseCtx<'a>) { + let scope_id = arrow.scope_id(); + let mut replaced = false; + for param in arrow.params.items.iter_mut() { + if Self::has_nested_object_rest(¶m.pattern) { + Self::replace_rest_element( + VariableDeclarationKind::Var, + &mut param.pattern, + &mut arrow.body.statements, + scope_id, + ctx, + ); + replaced = true; + } + } + if replaced && arrow.expression { + arrow.expression = false; + } + } + + // Transform `try {} catch (...x) {}`. + fn transform_catch_clause(clause: &mut CatchClause<'a>, ctx: &mut TraverseCtx<'a>) { + let Some(param) = &mut clause.param else { return }; + if Self::has_nested_object_rest(¶m.pattern) { + let scope_id = clause.body.scope_id(); + // Remove `SymbolFlags::CatchVariable`. + param.pattern.bound_names(&mut |ident| { + ctx.symbols_mut() + .get_flags_mut(ident.symbol_id()) + .remove(SymbolFlags::CatchVariable); + }); + Self::replace_rest_element( + VariableDeclarationKind::Var, + &mut param.pattern, + &mut clause.body.body, + scope_id, + ctx, + ); + // Add `SymbolFlags::CatchVariable`. + param.pattern.bound_names(&mut |ident| { + ctx.symbols_mut() + .get_flags_mut(ident.symbol_id()) + .insert(SymbolFlags::CatchVariable); + }); + } + } + + // Transform `for (var { ...x };;)`. + fn transform_variable_declaration_for_x_statement( + decl: &mut VariableDeclaration<'a>, + body: &mut Statement<'a>, + scope_id: ScopeId, + ctx: &mut TraverseCtx<'a>, + ) { + for declarator in decl.declarations.iter_mut() { + if Self::has_nested_object_rest(&declarator.id) { + let new_scope_id = Self::try_replace_statement_with_block(body, scope_id, ctx); + let Statement::BlockStatement(block) = body else { + unreachable!(); + }; + let mut bound_names = vec![]; + declarator.id.bound_names(&mut |ident| bound_names.push(ident.clone())); + Self::replace_rest_element( + declarator.kind, + &mut declarator.id, + &mut block.body, + scope_id, + ctx, + ); + // Move the bindings from the for init scope to scope of the loop body. + for ident in bound_names { + ctx.symbols_mut().set_scope_id(ident.symbol_id(), new_scope_id); + ctx.scopes_mut().move_binding(scope_id, new_scope_id, ident.name.into()); + } + } + } + } + + // If the assignment target contains an object rest, + // create a reference and move the assignment target to the block body. + // `for ({...x} in []);` `for ({...x} of []);` + // `for ([{...x}] in []);` `for ([{...x}] of []);` + fn transform_for_statement_left( + scope_id: ScopeId, + left: &mut ForStatementLeft<'a>, + body: &mut Statement<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + if let ForStatementLeft::VariableDeclaration(decl) = left { + Self::transform_variable_declaration_for_x_statement(decl, body, scope_id, ctx); + return; + } + if !Self::has_nested_target_rest(left.to_assignment_target()) { + return; + } + let target = left.to_assignment_target_mut(); + let assign_left = ctx.ast.move_assignment_target(target); + let flags = SymbolFlags::FunctionScopedVariable; + let bound_identifier = ctx.generate_uid("ref", scope_id, flags); + let id = bound_identifier.create_binding_pattern(ctx); + let kind = VariableDeclarationKind::Var; + let declarations = ctx.ast.vec1(ctx.ast.variable_declarator(SPAN, kind, id, None, false)); + let decl = ctx.ast.alloc_variable_declaration(SPAN, kind, declarations, false); + *left = ForStatementLeft::VariableDeclaration(decl); + Self::try_replace_statement_with_block(body, scope_id, ctx); + let Statement::BlockStatement(block) = body else { unreachable!(); }; + let operator = AssignmentOperator::Assign; + let right = bound_identifier.create_read_expression(ctx); + let expr = ctx.ast.expression_assignment(SPAN, operator, assign_left, right); + let stmt = ctx.ast.statement_expression(SPAN, expr); + block.body.insert(0, stmt); + } - let mut arguments = ctx.ast.vec(); - arguments.push(Argument::from(ctx.ast.move_expression(expr))); - arguments.push(Argument::from(ctx.ast.move_expression(&mut spread_prop.argument))); + fn try_replace_statement_with_block( + stmt: &mut Statement<'a>, + parent_scope_id: ScopeId, + ctx: &mut TraverseCtx<'a>, + ) -> ScopeId { + if let Statement::BlockStatement(block) = stmt { + return block.scope_id(); + } + let scope_id = ctx.create_child_scope(parent_scope_id, ScopeFlags::empty()); + let (span, stmts) = if let Statement::EmptyStatement(empty_stmt) = stmt { + (empty_stmt.span, ctx.ast.vec()) + } else { + let span = stmt.span(); + (span, ctx.ast.vec1(ctx.ast.move_statement(stmt))) + }; + *stmt = Statement::BlockStatement( + ctx.ast.alloc_block_statement_with_scope_id(span, stmts, scope_id), + ); + scope_id + } - let object_id = self.get_object_symbol_id(ctx); - let callee = self.get_extend_object_callee(object_id, ctx); + /// Recursively check for object rest. + fn has_nested_object_rest(pat: &BindingPattern<'a>) -> bool { + match &pat.kind { + BindingPatternKind::ObjectPattern(pat) => { + pat.rest.is_some() + || pat.properties.iter().any(|p| Self::has_nested_object_rest(&p.value)) + } + BindingPatternKind::ArrayPattern(pat) => { + pat.elements.iter().any(|e| e.as_ref().is_some_and(Self::has_nested_object_rest)) + || pat.rest.as_ref().is_some_and(|e| Self::has_nested_object_rest(&e.argument)) + } + BindingPatternKind::AssignmentPattern(pat) => Self::has_nested_object_rest(&pat.left), + BindingPatternKind::BindingIdentifier(_) => false, + } + } - // ({ ...x }) => _objectSpread({}, x) - *expr = ctx.ast.expression_call(SPAN, callee, NONE, arguments, false); + /// Move the binding to the body if it contains an object rest. + /// The object pattern will be transform by `transform_object_pattern` afterwards. + fn replace_rest_element( + kind: VariableDeclarationKind, + pattern: &mut BindingPattern<'a>, + body: &mut ArenaVec<'a, Statement<'a>>, + scope_id: ScopeId, + ctx: &mut TraverseCtx<'a>, + ) { + match &mut pattern.kind { + // Replace the object pattern, no need to walk the object properties. + BindingPatternKind::ObjectPattern(_) => { + Self::replace_object_pattern_and_insert_into_block_body( + kind, pattern, body, scope_id, ctx, + ); + } + BindingPatternKind::AssignmentPattern(pat) => { + Self::replace_object_pattern_and_insert_into_block_body( + kind, + &mut pat.left, + body, + scope_id, + ctx, + ); + } + // Or replace all occurrences of object pattern inside array pattern. + BindingPatternKind::ArrayPattern(pat) => { + for element in pat.elements.iter_mut().flatten() { + Self::replace_rest_element(kind, element, body, scope_id, ctx); + } + if let Some(element) = &mut pat.rest { + Self::replace_rest_element(kind, &mut element.argument, body, scope_id, ctx); + } + } + BindingPatternKind::BindingIdentifier(_) => {} + } + } - // ({ ...x, y, z }) => _objectSpread(_objectSpread({}, x), { y, z }); - if !obj_prop_list.is_empty() { - obj_prop_list.reverse(); - let mut arguments = ctx.ast.vec(); - arguments.push(Argument::from(ctx.ast.move_expression(expr))); - arguments.push(Argument::from(ctx.ast.expression_object(SPAN, obj_prop_list, None))); + // Add `let {...x} = _ref` to body. + fn replace_object_pattern_and_insert_into_block_body( + kind: VariableDeclarationKind, + pat: &mut BindingPattern<'a>, + body: &mut ArenaVec<'a, Statement<'a>>, + scope_id: ScopeId, + ctx: &mut TraverseCtx<'a>, + ) { + let decl = Self::create_temporary_reference_for_binding(kind, pat, scope_id, ctx); + body.insert(0, Statement::VariableDeclaration(ctx.ast.alloc(decl))); + } - let callee = self.get_extend_object_callee(object_id, ctx); + fn create_temporary_reference_for_binding( + kind: VariableDeclarationKind, + pat: &mut BindingPattern<'a>, + scope_id: ScopeId, + ctx: &mut TraverseCtx<'a>, + ) -> VariableDeclaration<'a> { + let bound_identifier = ctx.generate_uid("ref", scope_id, kind_to_symbol_flags(kind)); + let kind = VariableDeclarationKind::Let; + let id = mem::replace(pat, bound_identifier.create_binding_pattern(ctx)); + let init = bound_identifier.create_read_expression(ctx); + let declarations = + ctx.ast.vec1(ctx.ast.variable_declarator(SPAN, kind, id, Some(init), false)); + let decl = ctx.ast.variable_declaration(SPAN, kind, declarations, false); + decl.bound_names(&mut |ident| { + *ctx.symbols_mut().get_flags_mut(ident.symbol_id()) = SymbolFlags::BlockScopedVariable; + }); + decl + } +} - *expr = ctx.ast.expression_call(SPAN, callee, NONE, arguments, false); +impl<'a, 'ctx> ObjectRestSpread<'a, 'ctx> { + // Transform `let { x, ..y } = foo`. + // Transform `let [{ x, ..y }] = foo`. + fn transform_variable_declaration( + &mut self, + decl: &mut VariableDeclaration<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + let mut new_decls = vec![]; + for (i, variable_declarator) in decl.declarations.iter_mut().enumerate() { + if variable_declarator.init.is_some() + && Self::has_nested_object_rest(&variable_declarator.id) + { + let decls = self.transform_variable_declarator(variable_declarator, ctx); + new_decls.push((i, decls)); + } + } + for (i, decls) in new_decls { + decl.declarations.splice(i..=i, decls); } } - #[expect(clippy::option_option)] - fn get_object_symbol_id(&self, ctx: &mut TraverseCtx<'a>) -> Option> { - if self.options.set_spread_properties { - Some(ctx.scopes().find_binding(ctx.current_scope_id(), "Object")) + // The algorithm depth searches for object rest, + // and then creates a ref for the object, subsequent visit will then transform this object rest. + // Transforms: + // * `var {...a} = foo` -> `var a = _extends({}, (_objectDestructuringEmpty(foo), foo));` + // * `var [{x: {y: {...a}}}] = z` -> `var [{x: {y: _ref}}] = z, {...a} = _ref` + fn transform_variable_declarator( + &mut self, + decl: &mut VariableDeclarator<'a>, + ctx: &mut TraverseCtx<'a>, + ) -> ArenaVec<'a, VariableDeclarator<'a>> { + // It is syntax error or inside for loop if missing initializer in destructuring pattern. + let init = decl.init.as_mut().unwrap(); + + // Use the scope of the identifier, scope is different for + // `for (var {...x} = {};;);` and `for (let {...x} = {};;);` + // TODO: improve this by getting the value only once. + let mut scope_id = ctx.current_scope_id(); + let mut symbol_flags = kind_to_symbol_flags(decl.kind); + let symbols = ctx.symbols(); + decl.id.bound_names(&mut |ident| { + let symbol_id = ident.symbol_id(); + scope_id = symbols.get_scope_id(symbol_id); + symbol_flags.insert(symbols.get_flags(symbol_id)); + }); + + let state = State::new(decl.kind, symbol_flags, scope_id); + let mut new_decls = vec![]; + + let mut reference_builder = ReferenceBuilder::new(init, symbol_flags, scope_id, false, ctx); + let remove_empty_object_pattern; + + // Add `_foo = foo()` + if let Some(id) = reference_builder.binding.take() { + let decl = ctx.ast.variable_declarator( + SPAN, + state.kind, + id, + Some(reference_builder.create_read_expression(ctx)), + false, + ); + new_decls.push(decl); + } + + let mut temp_decls = vec![]; + let mut temp_keys = vec![]; + + if let BindingPatternKind::ObjectPattern(pat) = &mut decl.id.kind { + // Example: `let { x, ...rest } = foo();`. + remove_empty_object_pattern = pat.properties.is_empty(); + // Walk the properties that may contain a nested rest spread. + let data = pat + .properties + .iter_mut() + .flat_map(|p| self.recursive_walk_binding_pattern(&mut p.value, state, ctx)) + .collect::>(); + temp_decls.extend(data); + + // Transform the object pattern with a rest pattern. + if let Some(rest) = pat.rest.take() { + let lhs = BindingPatternOrAssignmentTarget::BindingPattern(rest.unbox().argument); + let mut all_primitives = true; + // Create the access keys. + // `let { a, b, ...c } = foo` -> `["a", "b"]` + let keys = ctx.ast.vec_from_iter(pat.properties.iter_mut().filter_map( + |binding_property| { + Self::transform_property_key( + &mut binding_property.key, + &mut temp_keys, + &mut all_primitives, + state, + ctx, + ) + }, + )); + let datum = SpreadPair { + lhs, + keys, + has_no_properties: pat.properties.is_empty(), + all_primitives, + }; + // Add `rest = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_foo), _foo))`. + // Or `rest = babelHelpers.objectWithoutProperties(_foo, ["x"])`. + let (lhs, rhs) = datum.get_lhs_rhs( + &mut reference_builder, + &mut self.excluded_variable_declarators, + self.ctx, + ctx, + ); + if let BindingPatternOrAssignmentTarget::BindingPattern(lhs) = lhs { + let decl = + ctx.ast.variable_declarator(lhs.span(), decl.kind, lhs, Some(rhs), false); + temp_decls.push(decl); + } + } } else { - None + remove_empty_object_pattern = false; + let data = self.recursive_walk_binding_pattern(&mut decl.id, state, ctx); + temp_decls.extend(data); + } + + new_decls.extend(temp_keys); + + // Insert the original declarator by copying its data out. + if !remove_empty_object_pattern { + let mut binding_pattern_kind = + ctx.ast.binding_pattern_kind_object_pattern(decl.span, ctx.ast.vec(), NONE); + mem::swap(&mut binding_pattern_kind, &mut decl.id.kind); + let decl = ctx.ast.variable_declarator( + decl.span, + decl.kind, + ctx.ast.binding_pattern(binding_pattern_kind, NONE, false), + Some(reference_builder.create_read_expression(ctx)), + false, + ); + new_decls.push(decl); } + + new_decls.extend(temp_decls); + ctx.ast.vec_from_iter(new_decls) } - #[expect(clippy::option_option)] - fn get_extend_object_callee( + // Returns all temporary references + fn recursive_walk_binding_pattern( &mut self, - object_id: Option>, + pat: &mut BindingPattern<'a>, + state: State, + ctx: &mut TraverseCtx<'a>, + ) -> Vec> { + match &mut pat.kind { + BindingPatternKind::BindingIdentifier(_) => vec![], + BindingPatternKind::ArrayPattern(array_pat) => array_pat + .elements + .iter_mut() + .flatten() + .flat_map(|p| self.recursive_walk_binding_pattern(p, state, ctx)) + .collect::>(), + BindingPatternKind::AssignmentPattern(assign_pat) => { + self.recursive_walk_binding_pattern(&mut assign_pat.left, state, ctx) + } + BindingPatternKind::ObjectPattern(p) => { + let data = p + .properties + .iter_mut() + .flat_map(|p| self.recursive_walk_binding_pattern(&mut p.value, state, ctx)) + .collect::>(); + if p.rest.is_some() { + let bound_identifier = + ctx.generate_uid("ref", state.scope_id, state.symbol_flags); + let id = mem::replace(pat, bound_identifier.create_binding_pattern(ctx)); + + let init = bound_identifier.create_read_expression(ctx); + let mut decl = + ctx.ast.variable_declarator(SPAN, state.kind, id, Some(init), false); + let mut decls = self + .transform_variable_declarator(&mut decl, ctx) + .into_iter() + .collect::>(); + decls.extend(data); + return decls; + } + data + } + } + } + + // Create a reference for computed property keys. + fn transform_property_key( + key: &mut PropertyKey<'a>, + new_decls: &mut Vec>, + all_primitives: &mut bool, + state: State, + ctx: &mut TraverseCtx<'a>, + ) -> Option> { + match key { + // `let { a, ... rest }` + PropertyKey::StaticIdentifier(ident) => { + let name = ident.name.clone(); + let expr = ctx.ast.expression_string_literal(ident.span, name); + Some(ArrayExpressionElement::from(expr)) + } + // `let { 'a', ... rest }` + // `let { ['a'], ... rest }` + PropertyKey::StringLiteral(lit) => { + let name = lit.value.clone(); + let expr = ctx.ast.expression_string_literal(lit.span, name.clone()); + Some(ArrayExpressionElement::from(expr)) + } + // `let { [`a`], ... rest }` + PropertyKey::TemplateLiteral(lit) if lit.is_no_substitution_template() => { + let expr = Expression::TemplateLiteral(lit.clone_in(ctx.ast.allocator)); + Some(ArrayExpressionElement::from(expr)) + } + PropertyKey::PrivateIdentifier(_) => { + /* syntax error */ + None + } + key => { + let expr = key.as_expression_mut()?; + // `let { [1], ... rest }` + if expr.is_literal() { + let span = expr.span(); + let s = expr.to_js_string().unwrap(); + let expr = ctx.ast.expression_string_literal(span, s); + return Some(ArrayExpressionElement::from(expr)); + } + *all_primitives = false; + if let Expression::Identifier(ident) = expr { + if !ident.is_global_reference(ctx.symbols()) { + let expr = MaybeBoundIdentifier::from_identifier_reference(ident, ctx) + .create_read_expression(ctx); + return Some(ArrayExpressionElement::from(expr)); + } + } + let bound_identifier = + ctx.generate_uid_based_on_node(expr, state.scope_id, state.symbol_flags); + let p = bound_identifier.create_binding_pattern(ctx); + let mut lhs = bound_identifier.create_read_expression(ctx); + mem::swap(&mut lhs, expr); + new_decls.push(ctx.ast.variable_declarator(SPAN, state.kind, p, Some(lhs), false)); + Some(ArrayExpressionElement::from(bound_identifier.create_read_expression(ctx))) + } + } + } +} + +#[derive(Debug, Clone, Copy)] +struct State { + kind: VariableDeclarationKind, + symbol_flags: SymbolFlags, + scope_id: ScopeId, +} + +impl State { + fn new(kind: VariableDeclarationKind, symbol_flags: SymbolFlags, scope_id: ScopeId) -> Self { + Self { kind, symbol_flags, scope_id } + } +} + +fn kind_to_symbol_flags(kind: VariableDeclarationKind) -> SymbolFlags { + match kind { + VariableDeclarationKind::Var => SymbolFlags::FunctionScopedVariable, + VariableDeclarationKind::Let + | VariableDeclarationKind::Using + | VariableDeclarationKind::AwaitUsing => SymbolFlags::BlockScopedVariable, + VariableDeclarationKind::Const => { + SymbolFlags::BlockScopedVariable | SymbolFlags::ConstVariable + } + } +} + +#[derive(Debug)] +enum BindingPatternOrAssignmentTarget<'a> { + BindingPattern(BindingPattern<'a>), + AssignmentTarget(AssignmentTarget<'a>), +} + +#[derive(Debug)] +struct SpreadPair<'a> { + lhs: BindingPatternOrAssignmentTarget<'a>, + keys: ArenaVec<'a, ArrayExpressionElement<'a>>, + has_no_properties: bool, + all_primitives: bool, +} + +impl<'a> SpreadPair<'a> { + fn get_lhs_rhs( + self, + reference_builder: &mut ReferenceBuilder<'a>, + excluded_variable_declarators: &mut Vec>, + transform_ctx: &TransformCtx<'a>, ctx: &mut TraverseCtx<'a>, - ) -> Expression<'a> { - if let Some(object_id) = object_id { - Self::object_assign(object_id, ctx) + ) -> (BindingPatternOrAssignmentTarget<'a>, Expression<'a>) { + let rhs = if self.has_no_properties { + // The `ObjectDestructuringEmpty` function throws a type error when destructuring null. + // `function _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cannot destructure " + t); }` + let mut arguments = ctx.ast.vec(); + // Add `{}`. + arguments.push(Argument::ObjectExpression(ctx.ast.alloc_object_expression( + SPAN, + ctx.ast.vec(), + None, + ))); + // Add `(_objectDestructuringEmpty(b), b);` + arguments.push(Argument::SequenceExpression(ctx.ast.alloc_sequence_expression( + SPAN, + { + let mut sequence = ctx.ast.vec(); + sequence.push(transform_ctx.helper_call_expr( + Helper::ObjectDestructuringEmpty, + SPAN, + ctx.ast.vec1(Argument::from(reference_builder.create_read_expression(ctx))), + ctx, + )); + sequence.push(reference_builder.create_read_expression(ctx)); + sequence + }, + ))); + transform_ctx.helper_call_expr(Helper::Extends, SPAN, arguments, ctx) } else { - self.ctx.helper_load(Helper::ObjectSpread2, ctx) + // / `let { a, b, ...c } = z` -> _objectWithoutProperties(_z, ["a", "b"]); + // / `_objectWithoutProperties(_z, ["a", "b"])` + let mut arguments = + ctx.ast.vec1(Argument::from(reference_builder.create_read_expression(ctx))); + let key_expression = ctx.ast.expression_array(SPAN, self.keys, None); + + let key_expression = if self.all_primitives + && ctx.scoping.current_scope_id() != ctx.scopes().root_scope_id() + { + // Move the key_expression to the root scope. + let bound_identifier = ctx.generate_uid_in_root_scope( + "excluded", + SymbolFlags::BlockScopedVariable | SymbolFlags::ConstVariable, + ); + let kind = VariableDeclarationKind::Const; + let declarator = ctx.ast.variable_declarator( + SPAN, + kind, + bound_identifier.create_binding_pattern(ctx), + Some(key_expression), + false, + ); + excluded_variable_declarators.push(declarator); + bound_identifier.create_read_expression(ctx) + } else if !self.all_primitives { + // map to `toPropertyKey` to handle the possible non-string values + // `[_ref].map(babelHelpers.toPropertyKey))` + let property = ctx.ast.identifier_name(SPAN, "map"); + let callee = Expression::StaticMemberExpression( + ctx.ast.alloc_static_member_expression(SPAN, key_expression, property, false), + ); + let arguments = ctx + .ast + .vec1(Argument::from(transform_ctx.helper_load(Helper::ToPropertyKey, ctx))); + ctx.ast.expression_call(SPAN, callee, NONE, arguments, false) + } else { + key_expression + }; + arguments.push(Argument::from(key_expression)); + transform_ctx.helper_call_expr(Helper::ObjectWithoutProperties, SPAN, arguments, ctx) + }; + (self.lhs, rhs) + } +} + +#[derive(Debug)] +struct ReferenceBuilder<'a> { + expr: Option>, + binding: Option>, + maybe_bound_identifier: MaybeBoundIdentifier<'a>, +} + +impl<'a> ReferenceBuilder<'a> { + fn new( + expr: &mut Expression<'a>, + symbol_flags: SymbolFlags, + scope_id: ScopeId, + force_create_binding: bool, + ctx: &mut TraverseCtx<'a>, + ) -> Self { + let expr = ctx.ast.move_expression(expr); + let binding; + let maybe_bound_identifier; + match &expr { + Expression::Identifier(ident) if !force_create_binding => { + binding = None; + maybe_bound_identifier = + MaybeBoundIdentifier::from_identifier_reference(ident, ctx); + } + expr => { + let bound_identifier = ctx.generate_uid_based_on_node(expr, scope_id, symbol_flags); + binding = Some(bound_identifier.create_binding_pattern(ctx)); + maybe_bound_identifier = bound_identifier.to_maybe_bound_identifier(); + } } + Self { expr: Some(expr), binding, maybe_bound_identifier } } - fn object_assign(symbol_id: Option, ctx: &mut TraverseCtx<'a>) -> Expression<'a> { - let object = - ctx.create_ident_expr(SPAN, Atom::from("Object"), symbol_id, ReferenceFlags::Read); - let property = ctx.ast.identifier_name(SPAN, Atom::from("assign")); - Expression::from(ctx.ast.member_expression_static(SPAN, object, property, false)) + fn create_read_expression(&mut self, ctx: &mut TraverseCtx<'a>) -> Expression<'a> { + self.expr.take().unwrap_or_else(|| self.maybe_bound_identifier.create_read_expression(ctx)) } } diff --git a/crates/oxc_transformer/src/jsx/jsx_impl.rs b/crates/oxc_transformer/src/jsx/jsx_impl.rs index 8d58728d9be144..aa4fe96a03e2ff 100644 --- a/crates/oxc_transformer/src/jsx/jsx_impl.rs +++ b/crates/oxc_transformer/src/jsx/jsx_impl.rs @@ -100,7 +100,10 @@ use oxc_syntax::{ }; use oxc_traverse::{BoundIdentifier, Traverse, TraverseCtx}; -use crate::TransformCtx; +use crate::{ + es2018::{ObjectRestSpread, ObjectRestSpreadOptions}, + TransformCtx, +}; use super::diagnostics; @@ -112,6 +115,7 @@ pub use super::{ pub struct JsxImpl<'a, 'ctx> { options: JsxOptions, + object_rest_spread_options: Option, ctx: &'ctx TransformCtx<'a>, @@ -369,7 +373,12 @@ impl<'a> Pragma<'a> { } impl<'a, 'ctx> JsxImpl<'a, 'ctx> { - pub fn new(options: JsxOptions, ast: AstBuilder<'a>, ctx: &'ctx TransformCtx<'a>) -> Self { + pub fn new( + options: JsxOptions, + object_rest_spread_options: Option, + ast: AstBuilder<'a>, + ctx: &'ctx TransformCtx<'a>, + ) -> Self { let bindings = match options.runtime { JsxRuntime::Classic => { if options.import_source.is_some() { @@ -434,6 +443,7 @@ impl<'a, 'ctx> JsxImpl<'a, 'ctx> { Self { options, + object_rest_spread_options, ctx, jsx_self: JsxSelf::new(ctx), jsx_source: JsxSource::new(ctx), @@ -649,7 +659,15 @@ impl<'a, 'ctx> JsxImpl<'a, 'ctx> { // If runtime is automatic that means we always to add `{ .. }` as the second argument even if it's empty if is_automatic || !properties.is_empty() { - let object_expression = ctx.ast.expression_object(SPAN, properties, None); + let mut object_expression = ctx.ast.expression_object(SPAN, properties, None); + if let Some(options) = self.object_rest_spread_options { + ObjectRestSpread::transform_object_expression( + options, + &mut object_expression, + self.ctx, + ctx, + ); + } arguments.push(Argument::from(object_expression)); } else if arguments.len() == 1 { // If not and second argument doesn't exist, we should add `null` as the second argument diff --git a/crates/oxc_transformer/src/jsx/mod.rs b/crates/oxc_transformer/src/jsx/mod.rs index 83097252a721be..75db0642141c0a 100644 --- a/crates/oxc_transformer/src/jsx/mod.rs +++ b/crates/oxc_transformer/src/jsx/mod.rs @@ -1,7 +1,7 @@ use oxc_ast::{ast::*, AstBuilder}; use oxc_traverse::{Traverse, TraverseCtx}; -use crate::TransformCtx; +use crate::{es2018::ObjectRestSpreadOptions, TransformCtx}; mod comments; mod diagnostics; @@ -42,7 +42,12 @@ pub struct Jsx<'a, 'ctx> { // Constructors impl<'a, 'ctx> Jsx<'a, 'ctx> { - pub fn new(mut options: JsxOptions, ast: AstBuilder<'a>, ctx: &'ctx TransformCtx<'a>) -> Self { + pub fn new( + mut options: JsxOptions, + object_rest_spread_options: Option, + ast: AstBuilder<'a>, + ctx: &'ctx TransformCtx<'a>, + ) -> Self { if options.jsx_plugin || options.development { options.conform(); } @@ -51,7 +56,7 @@ impl<'a, 'ctx> Jsx<'a, 'ctx> { } = options; let refresh = options.refresh.clone(); Self { - implementation: JsxImpl::new(options, ast, ctx), + implementation: JsxImpl::new(options, object_rest_spread_options, ast, ctx), display_name: ReactDisplayName::new(ctx), enable_jsx_plugin: jsx_plugin, display_name_plugin, diff --git a/crates/oxc_transformer/src/lib.rs b/crates/oxc_transformer/src/lib.rs index c665408c16e6bf..d20c05ce6909ea 100644 --- a/crates/oxc_transformer/src/lib.rs +++ b/crates/oxc_transformer/src/lib.rs @@ -114,7 +114,7 @@ impl<'a> Transformer<'a> { .source_type .is_typescript() .then(|| TypeScript::new(&self.typescript, &self.ctx)), - x1_jsx: Jsx::new(self.jsx, ast_builder, &self.ctx), + x1_jsx: Jsx::new(self.jsx, self.env.es2018.object_rest_spread, ast_builder, &self.ctx), x2_es2022: ES2022::new(self.env.es2022, &self.ctx), x2_es2021: ES2021::new(self.env.es2021, &self.ctx), x2_es2020: ES2020::new(self.env.es2020, &self.ctx), @@ -161,11 +161,11 @@ impl<'a, 'ctx> Traverse<'a> for TransformerImpl<'a, 'ctx> { if let Some(typescript) = self.x0_typescript.as_mut() { typescript.exit_program(program, ctx); } + self.x2_es2018.exit_program(program, ctx); self.common.exit_program(program, ctx); } // ALPHASORT - fn enter_arrow_function_expression( &mut self, arrow: &mut ArrowFunctionExpression<'a>, @@ -175,6 +175,15 @@ impl<'a, 'ctx> Traverse<'a> for TransformerImpl<'a, 'ctx> { if let Some(typescript) = self.x0_typescript.as_mut() { typescript.enter_arrow_function_expression(arrow, ctx); } + self.x2_es2018.enter_arrow_function_expression(arrow, ctx); + } + + fn enter_variable_declaration( + &mut self, + decl: &mut VariableDeclaration<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + self.x2_es2018.enter_variable_declaration(decl, ctx); } fn enter_variable_declarator( @@ -325,6 +334,7 @@ impl<'a, 'ctx> Traverse<'a> for TransformerImpl<'a, 'ctx> { fn enter_function(&mut self, func: &mut Function<'a>, ctx: &mut TraverseCtx<'a>) { self.common.enter_function(func, ctx); + self.x2_es2018.enter_function(func, ctx); } fn exit_function(&mut self, func: &mut Function<'a>, ctx: &mut TraverseCtx<'a>) { @@ -542,10 +552,12 @@ impl<'a, 'ctx> Traverse<'a> for TransformerImpl<'a, 'ctx> { if let Some(typescript) = self.x0_typescript.as_mut() { typescript.enter_for_in_statement(stmt, ctx); } + self.x2_es2018.enter_for_in_statement(stmt, ctx); } fn enter_catch_clause(&mut self, clause: &mut CatchClause<'a>, ctx: &mut TraverseCtx<'a>) { self.x2_es2019.enter_catch_clause(clause, ctx); + self.x2_es2018.enter_catch_clause(clause, ctx); } fn enter_import_declaration( diff --git a/crates/oxc_transformer/src/options/env.rs b/crates/oxc_transformer/src/options/env.rs index 1e384b8a38afad..a148068ae8571a 100644 --- a/crates/oxc_transformer/src/options/env.rs +++ b/crates/oxc_transformer/src/options/env.rs @@ -7,7 +7,7 @@ use crate::{ es2015::{ArrowFunctionsOptions, ES2015Options}, es2016::ES2016Options, es2017::ES2017Options, - es2018::ES2018Options, + es2018::{ES2018Options, ObjectRestSpreadOptions}, es2019::ES2019Options, es2020::ES2020Options, es2021::ES2021Options, @@ -71,7 +71,10 @@ impl EnvOptions { }, es2016: ES2016Options { exponentiation_operator: true }, es2017: ES2017Options { async_to_generator: true }, - es2018: ES2018Options { object_rest_spread: None, async_generator_functions: true }, + es2018: ES2018Options { + object_rest_spread: Some(ObjectRestSpreadOptions::default()), + async_generator_functions: true, + }, es2019: ES2019Options { optional_catch_binding: true }, es2020: ES2020Options { nullish_coalescing_operator: true, diff --git a/tasks/coverage/snapshots/runtime.snap b/tasks/coverage/snapshots/runtime.snap index 127d0c86e05b60..dc755bc9263159 100644 --- a/tasks/coverage/snapshots/runtime.snap +++ b/tasks/coverage/snapshots/runtime.snap @@ -2,7 +2,7 @@ commit: 06454619 runtime Summary: AST Parsed : 18055/18055 (100.00%) -Positive Passed: 17855/18055 (98.89%) +Positive Passed: 17851/18055 (98.87%) tasks/coverage/test262/test/language/expressions/assignment/fn-name-lhs-cover.js codegen error: Test262Error: descriptor value should be ; object value should be @@ -303,6 +303,9 @@ transform error: Test262Error: (-1n) ** -1n throws RangeError Expected a RangeEr tasks/coverage/test262/test/language/expressions/object/__proto__-permitted-dup-shorthand.js codegen error: Test262Error: Expected SameValue(«[object Object]», «2») to be true +tasks/coverage/test262/test/language/expressions/object/dstr/object-rest-proxy-gopd-not-called-on-excluded-keys.js +transform error: Test262Error: Actual [excludedString, 0, includedString, 1, Symbol(included_symbol)] and expected [Symbol(included_symbol), includedString, 1] should have the same contents. + tasks/coverage/test262/test/language/expressions/object/method-definition/async-gen-yield-star-async-next.js transform error: Test262Error: Expected SameValue(«"get next done (1)"», «"get next value (1)"») to be true @@ -348,6 +351,15 @@ transform error: SyntaxError: Identifier 'a' has already been declared tasks/coverage/test262/test/language/expressions/object/method-definition/async-super-call-param.js transform error: ReferenceError: _superprop_getMethod is not defined +tasks/coverage/test262/test/language/expressions/object/object-spread-proxy-get-not-called-on-dontenum-keys.js +transform error: Test262Error: Actual [dontEnumString, 0, enumerableString, 1, Symbol(dont_enum_symbol), Symbol(enumerable_symbol)] and expected [Symbol(dont_enum_symbol), dontEnumString, 0, Symbol(enumerable_symbol), enumerableString, 1] should have the same contents. + +tasks/coverage/test262/test/language/expressions/object/object-spread-proxy-no-excluded-keys.js +transform error: TypeError: Cannot read properties of undefined (reading 'enumerable') + +tasks/coverage/test262/test/language/expressions/object/object-spread-proxy-ownkeys-returned-keys-order.js +transform error: TypeError: Cannot read properties of undefined (reading 'enumerable') + tasks/coverage/test262/test/language/literals/regexp/u-surrogate-pairs-atom-escape-decimal.js codegen error: Test262Error: Expected SameValue(«true», «false») to be true diff --git a/tasks/coverage/snapshots/semantic_babel.snap b/tasks/coverage/snapshots/semantic_babel.snap index 46f236be07c909..60d45d7b4d8629 100644 --- a/tasks/coverage/snapshots/semantic_babel.snap +++ b/tasks/coverage/snapshots/semantic_babel.snap @@ -299,7 +299,13 @@ after transform: ["a7", "const", "d", "o4"] rebuilt : ["a7", "d", "o4"] tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/cast/destructuring-assignment-in-parens/input.ts -semantic error: Unresolved references mismatch: +semantic error: Reference flags mismatch for "a": +after transform: ReferenceId(14): ReferenceFlags(Write) +rebuilt : ReferenceId(13): ReferenceFlags(Read | Write) +Reference flags mismatch for "x": +after transform: ReferenceId(20): ReferenceFlags(Write) +rebuilt : ReferenceId(24): ReferenceFlags(Read | Write) +Unresolved references mismatch: after transform: ["T", "a", "b", "c", "x", "y"] rebuilt : ["a", "b", "c", "x", "y"] diff --git a/tasks/coverage/snapshots/semantic_test262.snap b/tasks/coverage/snapshots/semantic_test262.snap index 5d9e10c8bb08db..0e73f681f4d6ce 100644 --- a/tasks/coverage/snapshots/semantic_test262.snap +++ b/tasks/coverage/snapshots/semantic_test262.snap @@ -2,7 +2,7 @@ commit: 06454619 semantic_test262 Summary: AST Parsed : 43851/43851 (100.00%) -Positive Passed: 43038/43851 (98.15%) +Positive Passed: 42990/43851 (98.04%) tasks/coverage/test262/test/annexB/language/function-code/if-decl-else-decl-a-func-block-scoping.js semantic error: Symbol scope ID mismatch for "f": after transform: SymbolId(3): ScopeId(4294967294) @@ -6207,16 +6207,144 @@ semantic error: Symbol flags mismatch for "fn": after transform: SymbolId(1): SymbolFlags(BlockScopedVariable | Function) rebuilt : SymbolId(3): SymbolFlags(FunctionScopedVariable) +tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-descriptors.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(14): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-empty-obj.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(11): ScopeId(2) +rebuilt : SymbolId(13): ScopeId(3) + tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-getter.js -semantic error: Scope children mismatch: +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Scope children mismatch: after transform: ScopeId(7): [ScopeId(2)] rebuilt : ScopeId(5): [ScopeId(6), ScopeId(7)] Scope parent mismatch: after transform: ScopeId(3): Some(ScopeId(2)) rebuilt : ScopeId(6): Some(ScopeId(5)) +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(7): [] Scope children mismatch: after transform: ScopeId(2): [ScopeId(3), ScopeId(4)] rebuilt : ScopeId(7): [ScopeId(8)] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(14): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-number.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(11): ScopeId(2) +rebuilt : SymbolId(13): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-same-name.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(15): ScopeId(2) +rebuilt : SymbolId(16): ScopeId(3) +Reference flags mismatch for "x": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(15): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-skip-non-enumerable.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(14): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-str-val.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(11): ScopeId(2) +rebuilt : SymbolId(13): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-symbol-val.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(11): ScopeId(2) +rebuilt : SymbolId(13): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-to-property-with-setter.js +semantic error: Bindings mismatch: +after transform: ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(5): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(4): ["_step$value"] +rebuilt : ScopeId(8): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(14): ScopeId(4) +rebuilt : SymbolId(16): ScopeId(5) + +tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-to-property.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(11): ScopeId(2) +rebuilt : SymbolId(13): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-valid-object.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(13): ScopeId(2) +rebuilt : SymbolId(15): ScopeId(3) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(14): ReferenceFlags(Read | Write) +Reference flags mismatch for "b": +after transform: ReferenceId(1): ReferenceFlags(Write) +rebuilt : ReferenceId(15): ReferenceFlags(Read | Write) tasks/coverage/test262/test/language/statements/for-await-of/async-func-dstr-const-ary-ptrn-elem-id-init-fn-name-class.js semantic error: Bindings mismatch: @@ -7772,41 +7900,50 @@ rebuilt : SymbolId(15): ScopeId(4) tasks/coverage/test262/test/language/statements/for-await-of/async-func-dstr-var-async-obj-ptrn-rest-getter.js semantic error: Bindings mismatch: after transform: ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(5): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "x"] +rebuilt : ScopeId(5): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "x"] Bindings mismatch: -after transform: ScopeId(4): ["x"] +after transform: ScopeId(4): ["_step$value", "x"] rebuilt : ScopeId(8): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(14): ScopeId(4) +rebuilt : SymbolId(16): ScopeId(5) Symbol scope ID mismatch for "x": after transform: SymbolId(4): ScopeId(4) -rebuilt : SymbolId(14): ScopeId(5) +rebuilt : SymbolId(17): ScopeId(5) tasks/coverage/test262/test/language/statements/for-await-of/async-func-dstr-var-async-obj-ptrn-rest-skip-non-enumerable.js semantic error: Bindings mismatch: after transform: ScopeId(2): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(4): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "rest"] +rebuilt : ScopeId(4): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "rest"] Bindings mismatch: -after transform: ScopeId(3): ["rest"] +after transform: ScopeId(3): ["_step$value", "rest"] rebuilt : ScopeId(7): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(14): ScopeId(3) +rebuilt : SymbolId(16): ScopeId(4) Symbol scope ID mismatch for "rest": after transform: SymbolId(4): ScopeId(3) -rebuilt : SymbolId(14): ScopeId(4) +rebuilt : SymbolId(17): ScopeId(4) tasks/coverage/test262/test/language/statements/for-await-of/async-func-dstr-var-async-obj-ptrn-rest-val-obj.js semantic error: Bindings mismatch: after transform: ScopeId(2): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(4): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "a", "b", "rest"] +rebuilt : ScopeId(4): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "a", "b", "rest"] Bindings mismatch: -after transform: ScopeId(3): ["a", "b", "rest"] +after transform: ScopeId(3): ["_step$value", "a", "b", "rest"] rebuilt : ScopeId(7): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(15): ScopeId(3) +rebuilt : SymbolId(15): ScopeId(4) Symbol scope ID mismatch for "a": after transform: SymbolId(3): ScopeId(3) -rebuilt : SymbolId(13): ScopeId(4) +rebuilt : SymbolId(16): ScopeId(4) Symbol scope ID mismatch for "b": after transform: SymbolId(4): ScopeId(3) -rebuilt : SymbolId(14): ScopeId(4) +rebuilt : SymbolId(17): ScopeId(4) Symbol scope ID mismatch for "rest": after transform: SymbolId(5): ScopeId(3) -rebuilt : SymbolId(15): ScopeId(4) +rebuilt : SymbolId(18): ScopeId(4) tasks/coverage/test262/test/language/statements/for-await-of/async-func-dstr-var-obj-ptrn-id-get-value-err.js semantic error: Bindings mismatch: @@ -8207,7 +8344,7 @@ rebuilt : SymbolId(12): ScopeId(3) tasks/coverage/test262/test/language/statements/for-await-of/async-func-dstr-var-obj-ptrn-rest-getter.js semantic error: Bindings mismatch: after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "x"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "x"] Scope children mismatch: after transform: ScopeId(7): [ScopeId(2)] rebuilt : ScopeId(5): [ScopeId(6), ScopeId(7)] @@ -8215,42 +8352,51 @@ Scope parent mismatch: after transform: ScopeId(3): Some(ScopeId(2)) rebuilt : ScopeId(6): Some(ScopeId(5)) Bindings mismatch: -after transform: ScopeId(2): ["x"] +after transform: ScopeId(2): ["_step$value", "x"] rebuilt : ScopeId(7): [] Scope children mismatch: after transform: ScopeId(2): [ScopeId(3), ScopeId(4)] rebuilt : ScopeId(7): [ScopeId(8)] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(11): ScopeId(2) +rebuilt : SymbolId(13): ScopeId(3) Symbol scope ID mismatch for "x": after transform: SymbolId(3): ScopeId(2) -rebuilt : SymbolId(11): ScopeId(3) +rebuilt : SymbolId(14): ScopeId(3) tasks/coverage/test262/test/language/statements/for-await-of/async-func-dstr-var-obj-ptrn-rest-skip-non-enumerable.js semantic error: Bindings mismatch: after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "rest"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "rest"] Bindings mismatch: -after transform: ScopeId(2): ["rest"] +after transform: ScopeId(2): ["_step$value", "rest"] rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(11): ScopeId(2) +rebuilt : SymbolId(13): ScopeId(3) Symbol scope ID mismatch for "rest": after transform: SymbolId(3): ScopeId(2) -rebuilt : SymbolId(11): ScopeId(3) +rebuilt : SymbolId(14): ScopeId(3) tasks/coverage/test262/test/language/statements/for-await-of/async-func-dstr-var-obj-ptrn-rest-val-obj.js semantic error: Bindings mismatch: after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "a", "b", "rest"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "a", "b", "rest"] Bindings mismatch: -after transform: ScopeId(2): ["a", "b", "rest"] +after transform: ScopeId(2): ["_step$value", "a", "b", "rest"] rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(12): ScopeId(3) Symbol scope ID mismatch for "a": after transform: SymbolId(2): ScopeId(2) -rebuilt : SymbolId(10): ScopeId(3) +rebuilt : SymbolId(13): ScopeId(3) Symbol scope ID mismatch for "b": after transform: SymbolId(3): ScopeId(2) -rebuilt : SymbolId(11): ScopeId(3) +rebuilt : SymbolId(14): ScopeId(3) Symbol scope ID mismatch for "rest": after transform: SymbolId(4): ScopeId(2) -rebuilt : SymbolId(12): ScopeId(3) +rebuilt : SymbolId(15): ScopeId(3) tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-array-elem-init-fn-name-class.js semantic error: Bindings mismatch: @@ -8361,16 +8507,144 @@ semantic error: Symbol flags mismatch for "fn": after transform: SymbolId(1): SymbolFlags(BlockScopedVariable | Function) rebuilt : SymbolId(4): SymbolFlags(FunctionScopedVariable) +tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-descriptors.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(13): ScopeId(2) +rebuilt : SymbolId(15): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-empty-obj.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(14): ScopeId(3) + tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-getter.js -semantic error: Scope children mismatch: +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Scope children mismatch: after transform: ScopeId(7): [ScopeId(2)] rebuilt : ScopeId(5): [ScopeId(6), ScopeId(7)] Scope parent mismatch: after transform: ScopeId(3): Some(ScopeId(2)) rebuilt : ScopeId(6): Some(ScopeId(5)) +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(7): [] Scope children mismatch: after transform: ScopeId(2): [ScopeId(3), ScopeId(4)] rebuilt : ScopeId(7): [ScopeId(8)] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(13): ScopeId(2) +rebuilt : SymbolId(15): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-number.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(14): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-same-name.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(16): ScopeId(2) +rebuilt : SymbolId(17): ScopeId(3) +Reference flags mismatch for "x": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(17): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-skip-non-enumerable.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(13): ScopeId(2) +rebuilt : SymbolId(15): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-str-val.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(14): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-symbol-val.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(14): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-to-property-with-setter.js +semantic error: Bindings mismatch: +after transform: ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(5): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(4): ["_step$value"] +rebuilt : ScopeId(8): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(15): ScopeId(4) +rebuilt : SymbolId(17): ScopeId(5) + +tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-to-property.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(14): ScopeId(3) + +tasks/coverage/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-valid-object.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value"] +Bindings mismatch: +after transform: ScopeId(2): ["_step$value"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(14): ScopeId(2) +rebuilt : SymbolId(16): ScopeId(3) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(16): ReferenceFlags(Read | Write) +Reference flags mismatch for "b": +after transform: ReferenceId(1): ReferenceFlags(Write) +rebuilt : ReferenceId(17): ReferenceFlags(Read | Write) tasks/coverage/test262/test/language/statements/for-await-of/async-gen-dstr-const-ary-ptrn-elem-id-init-fn-name-class.js semantic error: Bindings mismatch: @@ -9926,41 +10200,50 @@ rebuilt : SymbolId(15): ScopeId(4) tasks/coverage/test262/test/language/statements/for-await-of/async-gen-dstr-var-async-obj-ptrn-rest-getter.js semantic error: Bindings mismatch: after transform: ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(5): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "x"] +rebuilt : ScopeId(5): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "x"] Bindings mismatch: -after transform: ScopeId(4): ["x"] +after transform: ScopeId(4): ["_step$value", "x"] rebuilt : ScopeId(8): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(15): ScopeId(4) +rebuilt : SymbolId(16): ScopeId(5) Symbol scope ID mismatch for "x": after transform: SymbolId(4): ScopeId(4) -rebuilt : SymbolId(14): ScopeId(5) +rebuilt : SymbolId(17): ScopeId(5) tasks/coverage/test262/test/language/statements/for-await-of/async-gen-dstr-var-async-obj-ptrn-rest-skip-non-enumerable.js semantic error: Bindings mismatch: after transform: ScopeId(2): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(4): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "rest"] +rebuilt : ScopeId(4): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "rest"] Bindings mismatch: -after transform: ScopeId(3): ["rest"] +after transform: ScopeId(3): ["_step$value", "rest"] rebuilt : ScopeId(7): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(15): ScopeId(3) +rebuilt : SymbolId(16): ScopeId(4) Symbol scope ID mismatch for "rest": after transform: SymbolId(4): ScopeId(3) -rebuilt : SymbolId(14): ScopeId(4) +rebuilt : SymbolId(17): ScopeId(4) tasks/coverage/test262/test/language/statements/for-await-of/async-gen-dstr-var-async-obj-ptrn-rest-val-obj.js semantic error: Bindings mismatch: after transform: ScopeId(2): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(4): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "a", "b", "rest"] +rebuilt : ScopeId(4): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "a", "b", "rest"] Bindings mismatch: -after transform: ScopeId(3): ["a", "b", "rest"] +after transform: ScopeId(3): ["_step$value", "a", "b", "rest"] rebuilt : ScopeId(7): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(16): ScopeId(3) +rebuilt : SymbolId(15): ScopeId(4) Symbol scope ID mismatch for "a": after transform: SymbolId(3): ScopeId(3) -rebuilt : SymbolId(13): ScopeId(4) +rebuilt : SymbolId(16): ScopeId(4) Symbol scope ID mismatch for "b": after transform: SymbolId(4): ScopeId(3) -rebuilt : SymbolId(14): ScopeId(4) +rebuilt : SymbolId(17): ScopeId(4) Symbol scope ID mismatch for "rest": after transform: SymbolId(5): ScopeId(3) -rebuilt : SymbolId(15): ScopeId(4) +rebuilt : SymbolId(18): ScopeId(4) tasks/coverage/test262/test/language/statements/for-await-of/async-gen-dstr-var-obj-ptrn-id-get-value-err.js semantic error: Bindings mismatch: @@ -10361,7 +10644,7 @@ rebuilt : SymbolId(13): ScopeId(3) tasks/coverage/test262/test/language/statements/for-await-of/async-gen-dstr-var-obj-ptrn-rest-getter.js semantic error: Bindings mismatch: after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "x"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "x"] Scope children mismatch: after transform: ScopeId(7): [ScopeId(2)] rebuilt : ScopeId(5): [ScopeId(6), ScopeId(7)] @@ -10369,42 +10652,51 @@ Scope parent mismatch: after transform: ScopeId(3): Some(ScopeId(2)) rebuilt : ScopeId(6): Some(ScopeId(5)) Bindings mismatch: -after transform: ScopeId(2): ["x"] +after transform: ScopeId(2): ["_step$value", "x"] rebuilt : ScopeId(7): [] Scope children mismatch: after transform: ScopeId(2): [ScopeId(3), ScopeId(4)] rebuilt : ScopeId(7): [ScopeId(8)] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(14): ScopeId(3) Symbol scope ID mismatch for "x": after transform: SymbolId(3): ScopeId(2) -rebuilt : SymbolId(12): ScopeId(3) +rebuilt : SymbolId(15): ScopeId(3) tasks/coverage/test262/test/language/statements/for-await-of/async-gen-dstr-var-obj-ptrn-rest-skip-non-enumerable.js semantic error: Bindings mismatch: after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "rest"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "rest"] Bindings mismatch: -after transform: ScopeId(2): ["rest"] +after transform: ScopeId(2): ["_step$value", "rest"] rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(12): ScopeId(2) +rebuilt : SymbolId(14): ScopeId(3) Symbol scope ID mismatch for "rest": after transform: SymbolId(3): ScopeId(2) -rebuilt : SymbolId(12): ScopeId(3) +rebuilt : SymbolId(15): ScopeId(3) tasks/coverage/test262/test/language/statements/for-await-of/async-gen-dstr-var-obj-ptrn-rest-val-obj.js semantic error: Bindings mismatch: after transform: ScopeId(1): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] -rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "a", "b", "rest"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_step$value", "a", "b", "rest"] Bindings mismatch: -after transform: ScopeId(2): ["a", "b", "rest"] +after transform: ScopeId(2): ["_step$value", "a", "b", "rest"] rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_step$value": +after transform: SymbolId(13): ScopeId(2) +rebuilt : SymbolId(13): ScopeId(3) Symbol scope ID mismatch for "a": after transform: SymbolId(2): ScopeId(2) -rebuilt : SymbolId(11): ScopeId(3) +rebuilt : SymbolId(14): ScopeId(3) Symbol scope ID mismatch for "b": after transform: SymbolId(3): ScopeId(2) -rebuilt : SymbolId(12): ScopeId(3) +rebuilt : SymbolId(15): ScopeId(3) Symbol scope ID mismatch for "rest": after transform: SymbolId(4): ScopeId(2) -rebuilt : SymbolId(13): ScopeId(3) +rebuilt : SymbolId(16): ScopeId(3) tasks/coverage/test262/test/language/statements/for-await-of/iterator-close-non-throw-get-method-is-null.js semantic error: Bindings mismatch: @@ -10478,6 +10770,509 @@ Symbol scope ID mismatch for "x": after transform: SymbolId(4): ScopeId(2) rebuilt : SymbolId(12): ScopeId(3) +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-computed-property-no-strict.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_objectWithoutProperties", "_toPropertyKey", "a", "counter"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "_ref", "_ref2", "_toPropertyKey", "a", "counter"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(2): ScopeId(1) +rebuilt : SymbolId(4): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(3): ScopeId(2) +rebuilt : SymbolId(5): ScopeId(0) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(4): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-computed-property.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_objectWithoutProperties", "_toPropertyKey", "a", "b", "counter", "rest"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "_ref", "_ref2", "_toPropertyKey", "a", "b", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(1) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(5): ScopeId(2) +rebuilt : SymbolId(7): ScopeId(0) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(4): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-descriptors.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "counter", "obj", "rest"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "counter", "obj", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(3): ScopeId(1) +rebuilt : SymbolId(5): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(4): ScopeId(2) +rebuilt : SymbolId(6): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-empty-obj.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "counter", "rest"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(2): ScopeId(1) +rebuilt : SymbolId(4): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(3): ScopeId(2) +rebuilt : SymbolId(5): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-getter-abrupt-get-error.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): [] +rebuilt : ScopeId(1): ["_ref", "_ref2"] +Bindings mismatch: +after transform: ScopeId(2): ["_ref"] +rebuilt : ScopeId(2): [] +Bindings mismatch: +after transform: ScopeId(4): ["_ref2"] +rebuilt : ScopeId(4): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(3): ScopeId(2) +rebuilt : SymbolId(5): ScopeId(1) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(4): ScopeId(4) +rebuilt : SymbolId(6): ScopeId(1) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-getter.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "count", "counter", "x"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "count", "counter", "x"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(3): ["_ref2"] +rebuilt : ScopeId(3): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(3): ScopeId(1) +rebuilt : SymbolId(5): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(4): ScopeId(3) +rebuilt : SymbolId(6): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-non-string-computed-property-1.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_objectWithoutProperties", "_toPropertyKey", "a", "b", "counter", "rest"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "_ref", "_ref2", "_toPropertyKey", "a", "b", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(1) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(5): ScopeId(2) +rebuilt : SymbolId(7): ScopeId(0) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(5): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-non-string-computed-property-1dot.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_objectWithoutProperties", "_toPropertyKey", "a", "b", "counter", "rest"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "_ref", "_ref2", "_toPropertyKey", "a", "b", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(1) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(5): ScopeId(2) +rebuilt : SymbolId(7): ScopeId(0) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(5): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-non-string-computed-property-1dot0.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_objectWithoutProperties", "_toPropertyKey", "a", "b", "counter", "rest"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "_ref", "_ref2", "_toPropertyKey", "a", "b", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(1) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(5): ScopeId(2) +rebuilt : SymbolId(7): ScopeId(0) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(5): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-non-string-computed-property-1e0.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_objectWithoutProperties", "_toPropertyKey", "a", "b", "counter", "rest"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "_ref", "_ref2", "_toPropertyKey", "a", "b", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(1) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(5): ScopeId(2) +rebuilt : SymbolId(7): ScopeId(0) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(5): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-non-string-computed-property-array-1.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_objectWithoutProperties", "_toPropertyKey", "a", "b", "counter", "rest"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "_ref", "_ref2", "_toPropertyKey", "a", "b", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(1) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(5): ScopeId(2) +rebuilt : SymbolId(7): ScopeId(0) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(5): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-non-string-computed-property-array-1e0.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_objectWithoutProperties", "_toPropertyKey", "a", "b", "counter", "rest"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "_ref", "_ref2", "_toPropertyKey", "a", "b", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(1) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(5): ScopeId(2) +rebuilt : SymbolId(7): ScopeId(0) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(5): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-non-string-computed-property-string-1.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_objectWithoutProperties", "_toPropertyKey", "a", "b", "counter", "rest"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "_ref", "_ref2", "_toPropertyKey", "a", "b", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(1) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(5): ScopeId(2) +rebuilt : SymbolId(7): ScopeId(0) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(5): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-number.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "counter", "rest"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(2): ScopeId(1) +rebuilt : SymbolId(4): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(3): ScopeId(2) +rebuilt : SymbolId(5): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-order.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "calls", "counter", "o", "rest"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "calls", "counter", "o", "rest"] +Bindings mismatch: +after transform: ScopeId(5): ["_ref"] +rebuilt : ScopeId(5): [] +Bindings mismatch: +after transform: ScopeId(6): ["_ref2"] +rebuilt : ScopeId(6): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(5) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(5): ScopeId(6) +rebuilt : SymbolId(7): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-put-const.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): [] +rebuilt : ScopeId(1): ["_ref", "_ref2"] +Bindings mismatch: +after transform: ScopeId(2): ["_ref"] +rebuilt : ScopeId(2): [] +Bindings mismatch: +after transform: ScopeId(3): ["_ref2"] +rebuilt : ScopeId(3): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(2): ScopeId(2) +rebuilt : SymbolId(4): ScopeId(1) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(3): ScopeId(3) +rebuilt : SymbolId(5): ScopeId(1) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-same-name.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_excluded", "_objectWithoutProperties", "counter", "keys", "o", "x", "y", "z"] +rebuilt : ScopeId(0): ["_excluded", "_objectWithoutProperties", "_ref", "_ref2", "counter", "keys", "o", "x", "y", "z"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(6): ScopeId(1) +rebuilt : SymbolId(7): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(7): ScopeId(2) +rebuilt : SymbolId(8): ScopeId(0) +Reference flags mismatch for "x": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(4): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-skip-non-enumerable.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "counter", "obj", "rest"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "counter", "obj", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(3): ScopeId(1) +rebuilt : SymbolId(5): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(4): ScopeId(2) +rebuilt : SymbolId(6): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-str-val.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "counter", "rest"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(2): ScopeId(1) +rebuilt : SymbolId(4): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(3): ScopeId(2) +rebuilt : SymbolId(5): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-symbol-val.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "counter", "rest"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(2): ScopeId(1) +rebuilt : SymbolId(4): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(3): ScopeId(2) +rebuilt : SymbolId(5): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-to-property-with-setter.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "counter", "executedGetter", "settedValue", "src"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "counter", "executedGetter", "settedValue", "src"] +Bindings mismatch: +after transform: ScopeId(3): ["_ref"] +rebuilt : ScopeId(3): [] +Bindings mismatch: +after transform: ScopeId(4): ["_ref2"] +rebuilt : ScopeId(4): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(5): ScopeId(3) +rebuilt : SymbolId(7): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(6): ScopeId(4) +rebuilt : SymbolId(8): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-to-property.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "counter", "src"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "counter", "src"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(2): ScopeId(1) +rebuilt : SymbolId(4): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(3): ScopeId(2) +rebuilt : SymbolId(5): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-val-null.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): [] +rebuilt : ScopeId(1): ["_ref", "_ref2"] +Bindings mismatch: +after transform: ScopeId(2): ["_ref"] +rebuilt : ScopeId(2): [] +Bindings mismatch: +after transform: ScopeId(3): ["_ref2"] +rebuilt : ScopeId(3): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(2): ScopeId(2) +rebuilt : SymbolId(4): ScopeId(1) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(3): ScopeId(3) +rebuilt : SymbolId(5): ScopeId(1) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-val-undefined.js +semantic error: Bindings mismatch: +after transform: ScopeId(1): [] +rebuilt : ScopeId(1): ["_ref", "_ref2"] +Bindings mismatch: +after transform: ScopeId(2): ["_ref"] +rebuilt : ScopeId(2): [] +Bindings mismatch: +after transform: ScopeId(3): ["_ref2"] +rebuilt : ScopeId(3): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(2): ScopeId(2) +rebuilt : SymbolId(4): ScopeId(1) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(3): ScopeId(3) +rebuilt : SymbolId(5): ScopeId(1) + +tasks/coverage/test262/test/language/statements/for-of/dstr/obj-rest-valid-object.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_excluded", "_objectWithoutProperties", "a", "b", "counter", "rest"] +rebuilt : ScopeId(0): ["_excluded", "_objectWithoutProperties", "_ref", "_ref2", "a", "b", "counter", "rest"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref2"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(1) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(5): ScopeId(2) +rebuilt : SymbolId(7): ScopeId(0) +Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(3): ReferenceFlags(Read | Write) +Reference flags mismatch for "b": +after transform: ReferenceId(1): ReferenceFlags(Write) +rebuilt : ReferenceId(4): ReferenceFlags(Read | Write) + +tasks/coverage/test262/test/language/statements/for-of/dstr/var-obj-ptrn-rest-getter.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "count", "iterCount", "x"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "count", "iterCount"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(3): [] +rebuilt : ScopeId(3): ["x"] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(3): ScopeId(1) +rebuilt : SymbolId(4): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/var-obj-ptrn-rest-skip-non-enumerable.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "iterCount", "o", "rest"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "iterCount", "o"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): [] +rebuilt : ScopeId(2): ["rest"] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(3): ScopeId(1) +rebuilt : SymbolId(4): ScopeId(0) + +tasks/coverage/test262/test/language/statements/for-of/dstr/var-obj-ptrn-rest-val-obj.js +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_excluded", "_objectWithoutProperties", "a", "b", "iterCount", "rest"] +rebuilt : ScopeId(0): ["_excluded", "_objectWithoutProperties", "_ref", "iterCount"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): [] +rebuilt : ScopeId(2): ["a", "b", "rest"] +Symbol scope ID mismatch for "_ref": +after transform: SymbolId(4): ScopeId(1) +rebuilt : SymbolId(3): ScopeId(0) + tasks/coverage/test262/test/language/statements/switch/scope-lex-async-function.js semantic error: Symbol flags mismatch for "x": after transform: SymbolId(0): SymbolFlags(BlockScopedVariable | Function) diff --git a/tasks/coverage/snapshots/semantic_typescript.snap b/tasks/coverage/snapshots/semantic_typescript.snap index 89f7499e0700a1..46a6c4f560bc04 100644 --- a/tasks/coverage/snapshots/semantic_typescript.snap +++ b/tasks/coverage/snapshots/semantic_typescript.snap @@ -2,7 +2,7 @@ commit: df9d1650 semantic_typescript Summary: AST Parsed : 6490/6490 (100.00%) -Positive Passed: 2663/6490 (41.03%) +Positive Passed: 2655/6490 (40.91%) tasks/coverage/typescript/tests/cases/compiler/2dArrays.ts semantic error: Symbol reference IDs mismatch for "Cell": after transform: SymbolId(0): [ReferenceId(1)] @@ -823,8 +823,8 @@ rebuilt : SymbolId(0) "M" tasks/coverage/typescript/tests/cases/compiler/anyAndUnknownHaveFalsyComponents.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["foo1", "foo2", "isTreeHeader1", "isTreeHeader2", "x1", "x2", "y1", "y2"] -rebuilt : ScopeId(0): ["foo1", "foo2", "y1", "y2"] +after transform: ScopeId(0): ["_objectSpread", "foo1", "foo2", "isTreeHeader1", "isTreeHeader2", "x1", "x2", "y1", "y2"] +rebuilt : ScopeId(0): ["_objectSpread", "foo1", "foo2", "y1", "y2"] Reference symbol mismatch for "x1": after transform: SymbolId(0) "x1" rebuilt : @@ -838,8 +838,8 @@ Reference symbol mismatch for "isTreeHeader1": after transform: SymbolId(2) "isTreeHeader1" rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["isTreeHeader1", "x1", "x2"] +after transform: ["require"] +rebuilt : ["isTreeHeader1", "require", "x1", "x2"] tasks/coverage/typescript/tests/cases/compiler/anyIsAssignableToObject.ts semantic error: Bindings mismatch: @@ -5573,8 +5573,8 @@ rebuilt : ["DMap"] tasks/coverage/typescript/tests/cases/compiler/contextualTypeObjectSpreadExpression.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["I", "i"] -rebuilt : ScopeId(0): ["i"] +after transform: ScopeId(0): ["I", "_objectSpread", "i"] +rebuilt : ScopeId(0): ["_objectSpread", "i"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] rebuilt : ScopeId(0): [] @@ -9066,8 +9066,8 @@ rebuilt : ScopeId(2): ["obj"] tasks/coverage/typescript/tests/cases/compiler/declarationEmitKeywordDestructuring.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["P", "f1", "f2", "f3", "f4", "f5"] -rebuilt : ScopeId(0): ["f1", "f2", "f3", "f4", "f5"] +after transform: ScopeId(0): ["P", "_excluded", "_excluded2", "_excluded3", "_excluded4", "_excluded5", "_objectWithoutProperties", "f1", "f2", "f3", "f4", "f5"] +rebuilt : ScopeId(0): ["_excluded", "_excluded2", "_excluded3", "_excluded4", "_excluded5", "_objectWithoutProperties", "f1", "f2", "f3", "f4", "f5"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5)] @@ -9535,7 +9535,7 @@ after transform: ScopeId(1): ScopeFlags(StrictMode) rebuilt : ScopeId(1): ScopeFlags(StrictMode | Function) Symbol flags mismatch for "AgeGroups": after transform: SymbolId(0): SymbolFlags(RegularEnum) -rebuilt : SymbolId(0): SymbolFlags(FunctionScopedVariable) +rebuilt : SymbolId(1): SymbolFlags(FunctionScopedVariable) tasks/coverage/typescript/tests/cases/compiler/declarationEmitStringEnumUsedInNonlocalSpread.ts semantic error: Bindings mismatch: @@ -9942,8 +9942,8 @@ rebuilt : [] tasks/coverage/typescript/tests/cases/compiler/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Key", "Value", "p1", "p2", "p3", "testRecFun", "updateIfChanged"] -rebuilt : ScopeId(0): ["p1", "p2", "p3", "testRecFun", "updateIfChanged"] +after transform: ScopeId(0): ["Key", "Value", "_objectSpread", "p1", "p2", "p3", "testRecFun", "updateIfChanged"] +rebuilt : ScopeId(0): ["_objectSpread", "p1", "p2", "p3", "testRecFun", "updateIfChanged"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(10)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(8)] @@ -10257,8 +10257,8 @@ rebuilt : [] tasks/coverage/typescript/tests/cases/compiler/deeplyNestedTemplateLiteralIntersection.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Props", "R", "S", "T", "X", "_S", "a1", "a2", "b"] -rebuilt : ScopeId(0): ["a1", "a2", "b"] +after transform: ScopeId(0): ["Props", "R", "S", "T", "X", "_S", "_objectSpread", "a1", "a2", "b"] +rebuilt : ScopeId(0): ["_objectSpread", "a1", "a2", "b"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6)] rebuilt : ScopeId(0): [] @@ -10634,8 +10634,8 @@ rebuilt : ScopeId(1): [] tasks/coverage/typescript/tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Child", "Parent", "Props", "SFC"] -rebuilt : ScopeId(0): ["Child", "Parent"] +after transform: ScopeId(0): ["Child", "Parent", "Props", "SFC", "_excluded", "_excluded2", "_objectSpread", "_objectWithoutProperties"] +rebuilt : ScopeId(0): ["Child", "Parent", "_excluded", "_excluded2", "_objectSpread", "_objectWithoutProperties"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3)] @@ -11553,8 +11553,8 @@ rebuilt : ["MyClassDecorator", "MyMethodDecorator"] tasks/coverage/typescript/tests/cases/compiler/emitHelpersWithLocalCollisions.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["A", "__decorate", "dec", "o", "y"] -rebuilt : ScopeId(0): ["A", "o", "y"] +after transform: ScopeId(0): ["A", "__decorate", "_objectSpread", "dec", "o", "y"] +rebuilt : ScopeId(0): ["A", "_objectSpread", "o", "y"] Reference symbol mismatch for "dec": after transform: SymbolId(0) "dec" rebuilt : @@ -15231,6 +15231,14 @@ Reference flags mismatch for "X": after transform: ReferenceId(2): ReferenceFlags(Read | Type) rebuilt : ReferenceId(1): ReferenceFlags(Read) +tasks/coverage/typescript/tests/cases/compiler/exportObjectRest.ts +semantic error: Symbol flags mismatch for "x": +after transform: SymbolId(0): SymbolFlags(BlockScopedVariable | ConstVariable | Export) +rebuilt : SymbolId(2): SymbolFlags(BlockScopedVariable | ConstVariable) +Symbol flags mismatch for "rest": +after transform: SymbolId(1): SymbolFlags(BlockScopedVariable | ConstVariable | Export) +rebuilt : SymbolId(3): SymbolFlags(BlockScopedVariable | ConstVariable) + tasks/coverage/typescript/tests/cases/compiler/exportPrivateType.ts semantic error: Namespaces exporting non-const are not supported by Babel. Change to const or see: https://babeljs.io/docs/en/babel-plugin-transform-typescript Namespaces exporting non-const are not supported by Babel. Change to const or see: https://babeljs.io/docs/en/babel-plugin-transform-typescript @@ -17371,8 +17379,8 @@ rebuilt : SymbolId(0): [] tasks/coverage/typescript/tests/cases/compiler/genericObjectSpreadResultInSwitch.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Params", "getType", "params"] -rebuilt : ScopeId(0): ["getType"] +after transform: ScopeId(0): ["Params", "_excluded", "_objectWithoutProperties", "getType", "params"] +rebuilt : ScopeId(0): ["_excluded", "_objectWithoutProperties", "getType"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] @@ -17389,8 +17397,8 @@ Reference symbol mismatch for "params": after transform: SymbolId(6) "params" rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["params"] +after transform: ["require"] +rebuilt : ["params", "require"] tasks/coverage/typescript/tests/cases/compiler/genericOfACloduleType1.ts semantic error: Missing SymbolId: "M" @@ -18120,14 +18128,14 @@ rebuilt : [] tasks/coverage/typescript/tests/cases/compiler/identityAndDivergentNormalizedTypes.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["ApiPost", "PostBody", "PostPath", "fx1", "post", "tmp"] -rebuilt : ScopeId(0): ["fx1", "post", "tmp"] +after transform: ScopeId(0): ["ApiPost", "PostBody", "PostPath", "_excluded", "_objectWithoutProperties", "fx1", "post", "tmp"] +rebuilt : ScopeId(0): ["_excluded", "_objectWithoutProperties", "fx1", "post", "tmp"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3)] Bindings mismatch: -after transform: ScopeId(4): ["PATH", "body", "options", "path"] -rebuilt : ScopeId(1): ["body", "options", "path"] +after transform: ScopeId(4): ["PATH", "_ref", "body", "options", "path"] +rebuilt : ScopeId(1): ["_ref", "body", "options", "path"] Bindings mismatch: after transform: ScopeId(5): ["PATH", "body", "path"] rebuilt : ScopeId(2): ["body", "path"] @@ -18135,8 +18143,8 @@ Bindings mismatch: after transform: ScopeId(6): ["P", "x", "y"] rebuilt : ScopeId(3): ["x", "y"] Unresolved references mismatch: -after transform: ["Extract", "Omit", "RequestInit"] -rebuilt : [] +after transform: ["Extract", "Omit", "RequestInit", "require"] +rebuilt : ["require"] tasks/coverage/typescript/tests/cases/compiler/identityRelationNeverTypes.ts semantic error: Bindings mismatch: @@ -18377,8 +18385,8 @@ rebuilt : ["dec"] tasks/coverage/typescript/tests/cases/compiler/importHelpersES6.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["A", "_asyncToGenerator", "dec", "o", "y"] -rebuilt : ScopeId(0): ["A", "_asyncToGenerator", "o", "y"] +after transform: ScopeId(0): ["A", "_asyncToGenerator", "_objectSpread", "dec", "o", "y"] +rebuilt : ScopeId(0): ["A", "_asyncToGenerator", "_objectSpread", "o", "y"] Reference symbol mismatch for "dec": after transform: SymbolId(0) "dec" rebuilt : @@ -18424,8 +18432,8 @@ rebuilt : ["React", "o"] tasks/coverage/typescript/tests/cases/compiler/importHelpersWithLocalCollisions.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["A", "__decorate", "dec", "o", "y"] -rebuilt : ScopeId(0): ["A", "o", "y"] +after transform: ScopeId(0): ["A", "__decorate", "_objectSpread", "dec", "o", "y"] +rebuilt : ScopeId(0): ["A", "_objectSpread", "o", "y"] Reference symbol mismatch for "dec": after transform: SymbolId(0) "dec" rebuilt : @@ -19349,8 +19357,8 @@ rebuilt : ["test", "x1", "x2"] tasks/coverage/typescript/tests/cases/compiler/inferenceOptionalPropertiesToIndexSignatures.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["a1", "a2", "a3", "a4", "obj", "param2", "query", "x1", "x2", "x3", "x4"] -rebuilt : ScopeId(0): ["a1", "a2", "a3", "a4", "obj", "param2", "query"] +after transform: ScopeId(0): ["_objectSpread", "a1", "a2", "a3", "a4", "obj", "param2", "query", "x1", "x2", "x3", "x4"] +rebuilt : ScopeId(0): ["_objectSpread", "a1", "a2", "a3", "a4", "obj", "param2", "query"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [ScopeId(1)] @@ -19367,8 +19375,8 @@ Reference symbol mismatch for "x4": after transform: SymbolId(5) "x4" rebuilt : Unresolved references mismatch: -after transform: ["Math", "Object", "encodeURIComponent", "foo"] -rebuilt : ["Math", "Object", "encodeURIComponent", "foo", "x1", "x2", "x3", "x4"] +after transform: ["Math", "Object", "encodeURIComponent", "foo", "require"] +rebuilt : ["Math", "Object", "encodeURIComponent", "foo", "require", "x1", "x2", "x3", "x4"] tasks/coverage/typescript/tests/cases/compiler/inferenceOuterResultNotIncorrectlyInstantiatedWithInnerResult.ts semantic error: Bindings mismatch: @@ -21782,8 +21790,8 @@ rebuilt : SymbolId(0): [ReferenceId(0), ReferenceId(2), ReferenceId(3), R tasks/coverage/typescript/tests/cases/compiler/jsxComplexSignatureHasApplicabilityError.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["ArrowRendererHandler", "ArrowRendererProps", "AutocompleteResult", "ClearRendererHandler", "ExtractValueType", "FilterOptionHandler", "FilterOptionsHandler", "FocusOptionHandler", "HandlerRendererResult", "InputRendererHandler", "IsOptionUniqueHandler", "IsValidNewOptionHandler", "LoadOptionsAsyncHandler", "LoadOptionsHandler", "LoadOptionsLegacyHandler", "MenuRendererHandler", "MenuRendererProps", "NewOptionCreatorHandler", "Omit", "OnBlurHandler", "OnChangeHandler", "OnChangeMultipleHandler", "OnChangeSingleHandler", "OnCloseHandler", "OnFocusHandler", "OnInputChangeHandler", "OnInputKeyDownHandler", "OnMenuScrollToBottomHandler", "OnNewOptionClickHandler", "OnOpenHandler", "OnValueClickHandler", "Option", "OptionComponentProps", "OptionComponentType", "OptionRendererHandler", "OptionValues", "Options", "Overwrite", "PromptTextCreatorHandler", "Props", "React", "ReactSelectProps", "ReactSingleSelectProps", "SelectValueHandler", "ShouldKeyDownEventCreateNewOptionHandler", "ValueComponentProps", "ValueComponentType", "ValueRendererHandler", "_jsxFileName", "createReactSingleSelect"] -rebuilt : ScopeId(0): ["React", "_jsxFileName", "createReactSingleSelect"] +after transform: ScopeId(0): ["ArrowRendererHandler", "ArrowRendererProps", "AutocompleteResult", "ClearRendererHandler", "ExtractValueType", "FilterOptionHandler", "FilterOptionsHandler", "FocusOptionHandler", "HandlerRendererResult", "InputRendererHandler", "IsOptionUniqueHandler", "IsValidNewOptionHandler", "LoadOptionsAsyncHandler", "LoadOptionsHandler", "LoadOptionsLegacyHandler", "MenuRendererHandler", "MenuRendererProps", "NewOptionCreatorHandler", "Omit", "OnBlurHandler", "OnChangeHandler", "OnChangeMultipleHandler", "OnChangeSingleHandler", "OnCloseHandler", "OnFocusHandler", "OnInputChangeHandler", "OnInputKeyDownHandler", "OnMenuScrollToBottomHandler", "OnNewOptionClickHandler", "OnOpenHandler", "OnValueClickHandler", "Option", "OptionComponentProps", "OptionComponentType", "OptionRendererHandler", "OptionValues", "Options", "Overwrite", "PromptTextCreatorHandler", "Props", "React", "ReactSelectProps", "ReactSingleSelectProps", "SelectValueHandler", "ShouldKeyDownEventCreateNewOptionHandler", "ValueComponentProps", "ValueComponentType", "ValueRendererHandler", "_jsxFileName", "_objectSpread", "createReactSingleSelect"] +rebuilt : ScopeId(0): ["React", "_jsxFileName", "_objectSpread", "createReactSingleSelect"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(3), ScopeId(5), ScopeId(6), ScopeId(10), ScopeId(12), ScopeId(13), ScopeId(16), ScopeId(17), ScopeId(18), ScopeId(19), ScopeId(20), ScopeId(21), ScopeId(22), ScopeId(23), ScopeId(24), ScopeId(25), ScopeId(26), ScopeId(27), ScopeId(28), ScopeId(29), ScopeId(30), ScopeId(31), ScopeId(32), ScopeId(33), ScopeId(34), ScopeId(35), ScopeId(36), ScopeId(37), ScopeId(38), ScopeId(39), ScopeId(40), ScopeId(41), ScopeId(42), ScopeId(43), ScopeId(44), ScopeId(45), ScopeId(46), ScopeId(47), ScopeId(48), ScopeId(49), ScopeId(50), ScopeId(51), ScopeId(52), ScopeId(53), ScopeId(54), ScopeId(55), ScopeId(56), ScopeId(57)] rebuilt : ScopeId(0): [ScopeId(1)] @@ -21791,7 +21799,7 @@ Bindings mismatch: after transform: ScopeId(6): ["WrappedComponent", "WrappedProps"] rebuilt : ScopeId(1): ["WrappedComponent"] Symbol reference IDs mismatch for "React": -after transform: SymbolId(0): [ReferenceId(17), ReferenceId(19), ReferenceId(44), ReferenceId(50), ReferenceId(54), ReferenceId(82), ReferenceId(85), ReferenceId(88), ReferenceId(102), ReferenceId(180), ReferenceId(195), ReferenceId(206), ReferenceId(209), ReferenceId(233), ReferenceId(236), ReferenceId(240)] +after transform: SymbolId(0): [ReferenceId(17), ReferenceId(19), ReferenceId(44), ReferenceId(50), ReferenceId(54), ReferenceId(82), ReferenceId(85), ReferenceId(88), ReferenceId(102), ReferenceId(180), ReferenceId(195), ReferenceId(206), ReferenceId(209), ReferenceId(233), ReferenceId(236), ReferenceId(242)] rebuilt : SymbolId(0): [ReferenceId(0)] Unresolved references mismatch: after transform: ["Array", "Exclude", "HTMLAnchorElement", "HTMLDivElement", "HTMLInputElement", "JSX", "Pick", "Promise", "ReactSelectClass", "undefined"] @@ -21994,8 +22002,8 @@ rebuilt : ScopeId(0): [ScopeId(1)] tasks/coverage/typescript/tests/cases/compiler/jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["_jsxFileName", "_reactJsxRuntime", "otherProps"] -rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime"] +after transform: ScopeId(0): ["_jsxFileName", "_objectSpread", "_reactJsxRuntime", "otherProps"] +rebuilt : ScopeId(0): ["_jsxFileName", "_objectSpread", "_reactJsxRuntime"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3)] rebuilt : ScopeId(0): [] @@ -25422,8 +25430,8 @@ rebuilt : ScopeId(2): ["pet", "voice"] tasks/coverage/typescript/tests/cases/compiler/narrowingDestructuring.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["X", "Z", "farr", "func", "func2", "func3"] -rebuilt : ScopeId(0): ["farr", "func", "func2", "func3"] +after transform: ScopeId(0): ["X", "Z", "_excluded", "_excluded2", "_excluded3", "_excluded4", "_objectWithoutProperties", "farr", "func", "func2", "func3"] +rebuilt : ScopeId(0): ["_excluded", "_excluded2", "_excluded3", "_excluded4", "_objectWithoutProperties", "farr", "func", "func2", "func3"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(5), ScopeId(6), ScopeId(9), ScopeId(12)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(4), ScopeId(7), ScopeId(10)] @@ -25450,8 +25458,8 @@ rebuilt : ScopeId(0): [ScopeId(1), ScopeId(3), ScopeId(4)] tasks/coverage/typescript/tests/cases/compiler/narrowingNoInfer1.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["TaggedA", "TaggedB", "TaggedUnion", "m", "map", "something"] -rebuilt : ScopeId(0): ["m", "map", "something"] +after transform: ScopeId(0): ["TaggedA", "TaggedB", "TaggedUnion", "_objectSpread", "m", "map", "something"] +rebuilt : ScopeId(0): ["_objectSpread", "m", "map", "something"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3)] @@ -25459,8 +25467,8 @@ Bindings mismatch: after transform: ScopeId(4): ["A", "B", "f", "items"] rebuilt : ScopeId(1): ["f", "items"] Unresolved references mismatch: -after transform: ["NoInfer", "const", "test2"] -rebuilt : ["test2"] +after transform: ["NoInfer", "const", "require", "test2"] +rebuilt : ["require", "test2"] tasks/coverage/typescript/tests/cases/compiler/narrowingPastLastAssignmentInModule.ts semantic error: Unresolved references mismatch: @@ -25469,8 +25477,8 @@ rebuilt : [] tasks/coverage/typescript/tests/cases/compiler/narrowingRestGenericCall.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Slugs", "call", "obj"] -rebuilt : ScopeId(0): ["call"] +after transform: ScopeId(0): ["Slugs", "_excluded", "_objectWithoutProperties", "call", "obj"] +rebuilt : ScopeId(0): ["_excluded", "_objectWithoutProperties", "call"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] @@ -25481,8 +25489,8 @@ Reference symbol mismatch for "obj": after transform: SymbolId(5) "obj" rebuilt : Unresolved references mismatch: -after transform: ["console"] -rebuilt : ["console", "obj"] +after transform: ["console", "require"] +rebuilt : ["console", "obj", "require"] tasks/coverage/typescript/tests/cases/compiler/narrowingTypeofDiscriminant.ts semantic error: Bindings mismatch: @@ -25722,6 +25730,32 @@ Scope flags mismatch: after transform: ScopeId(2): ScopeFlags(StrictMode | Function) rebuilt : ScopeId(2): ScopeFlags(Function) +tasks/coverage/typescript/tests/cases/compiler/nestedObjectRest.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "x", "y"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "_ref", "_ref2", "_ref3", "_ref4", "_ref5", "x", "y"] +Bindings mismatch: +after transform: ScopeId(1): ["_ref3"] +rebuilt : ScopeId(1): [] +Bindings mismatch: +after transform: ScopeId(2): ["_ref4", "_ref5"] +rebuilt : ScopeId(2): [] +Symbol scope ID mismatch for "_ref3": +after transform: SymbolId(6): ScopeId(1) +rebuilt : SymbolId(6): ScopeId(0) +Symbol scope ID mismatch for "_ref4": +after transform: SymbolId(7): ScopeId(2) +rebuilt : SymbolId(7): ScopeId(0) +Symbol scope ID mismatch for "_ref5": +after transform: SymbolId(8): ScopeId(2) +rebuilt : SymbolId(8): ScopeId(0) +Reference flags mismatch for "_ref": +after transform: ReferenceId(3): ReferenceFlags(Write) +rebuilt : ReferenceId(2): ReferenceFlags(Read | Write) +Reference flags mismatch for "_ref4": +after transform: ReferenceId(13): ReferenceFlags(Write) +rebuilt : ReferenceId(12): ReferenceFlags(Read | Write) + tasks/coverage/typescript/tests/cases/compiler/nestedSelf.ts semantic error: Missing SymbolId: "M" Missing SymbolId: "_M" @@ -26469,8 +26503,8 @@ rebuilt : ScopeId(0): [ScopeId(1)] tasks/coverage/typescript/tests/cases/compiler/objectInstantiationFromUnionSpread.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Fail", "Item", "Success", "f1", "f2"] -rebuilt : ScopeId(0): ["f1", "f2"] +after transform: ScopeId(0): ["Fail", "Item", "Success", "_objectSpread", "f1", "f2"] +rebuilt : ScopeId(0): ["_objectSpread", "f1", "f2"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(7)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(4)] @@ -26478,8 +26512,8 @@ Bindings mismatch: after transform: ScopeId(7): ["T", "a"] rebuilt : ScopeId(4): ["a"] Unresolved references mismatch: -after transform: ["true"] -rebuilt : [] +after transform: ["require", "true"] +rebuilt : ["require"] tasks/coverage/typescript/tests/cases/compiler/objectLitGetterSetter.ts semantic error: Unresolved references mismatch: @@ -26557,8 +26591,8 @@ rebuilt : SymbolId(0): [] tasks/coverage/typescript/tests/cases/compiler/objectRestBindingContextualInference.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["ImageHolder", "SetupImageRefs", "SetupImages", "TestInterface", "prepare", "rest", "test"] -rebuilt : ScopeId(0): ["prepare", "rest"] +after transform: ScopeId(0): ["ImageHolder", "SetupImageRefs", "SetupImages", "TestInterface", "_objectWithoutProperties", "_setupImages", "prepare", "rest", "test"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "_setupImages", "prepare", "rest"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(3), ScopeId(5), ScopeId(6), ScopeId(7)] rebuilt : ScopeId(0): [] @@ -26566,8 +26600,43 @@ Reference symbol mismatch for "test": after transform: SymbolId(13) "test" rebuilt : Unresolved references mismatch: -after transform: ["File", "setupImages"] -rebuilt : ["setupImages", "test"] +after transform: ["File", "require", "setupImages"] +rebuilt : ["require", "setupImages", "test"] + +tasks/coverage/typescript/tests/cases/compiler/objectRestSpread.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_excluded", "_extends", "_obj", "_objectDestructuringEmpty", "_objectSpread", "_objectWithoutProperties", "_ref", "_ref2", "_ref3", "_ref4", "_ref5", "_ref6", "_toPropertyKey", "_wrapAsyncGenerator", "fn", "more", "nestedProp", "nestedRest", "obj", "other", "prop", "props", "test"] +rebuilt : ScopeId(0): ["_excluded", "_extends", "_objectDestructuringEmpty", "_objectSpread", "_objectWithoutProperties", "_ref", "_ref2", "_ref3", "_ref4", "_ref5", "_ref6", "_toPropertyKey", "_wrapAsyncGenerator", "fn", "more", "nestedProp", "nestedRest", "obj", "other", "prop", "props", "test"] +Reference symbol mismatch for "_obj": +after transform: SymbolId(18) "_obj" +rebuilt : +Reference symbol mismatch for "_obj": +after transform: SymbolId(18) "_obj" +rebuilt : +Reference symbol mismatch for "_obj": +after transform: SymbolId(18) "_obj" +rebuilt : +Reference symbol mismatch for "_obj": +after transform: SymbolId(18) "_obj" +rebuilt : +Reference symbol mismatch for "_obj": +after transform: SymbolId(18) "_obj" +rebuilt : +Reference flags mismatch for "prop": +after transform: ReferenceId(8): ReferenceFlags(Write) +rebuilt : ReferenceId(42): ReferenceFlags(Read | Write) +Reference flags mismatch for "_objectSpread": +after transform: ReferenceId(49): ReferenceFlags(Read) +rebuilt : ReferenceId(43): ReferenceFlags(Read | Write) +Reference flags mismatch for "obj": +after transform: ReferenceId(9): ReferenceFlags(Write) +rebuilt : ReferenceId(44): ReferenceFlags(Read | Write) +Reference flags mismatch for "_ref6": +after transform: ReferenceId(41): ReferenceFlags(Read) +rebuilt : ReferenceId(45): ReferenceFlags(Read | Write) +Unresolved references mismatch: +after transform: ["require"] +rebuilt : ["_obj", "require"] tasks/coverage/typescript/tests/cases/compiler/observableInferenceCanBeMade.ts semantic error: Bindings mismatch: @@ -31332,8 +31401,8 @@ rebuilt : ScopeId(0): ["_jsx", "_jsxFileName"] tasks/coverage/typescript/tests/cases/compiler/reactNamespaceJSXEmit.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Bar", "_Bar", "_jsxFileName", "foo", "myReactLib", "x"] -rebuilt : ScopeId(0): ["_jsxFileName"] +after transform: ScopeId(0): ["Bar", "_Bar", "_jsxFileName", "_objectSpread", "foo", "myReactLib", "x"] +rebuilt : ScopeId(0): ["_jsxFileName", "_objectSpread"] Reference symbol mismatch for "Bar": after transform: SymbolId(2) "Bar" rebuilt : @@ -31367,7 +31436,7 @@ semantic error: Bindings mismatch: after transform: ScopeId(1): ["Inner", "P"] rebuilt : ScopeId(1): ["Inner"] Symbol reference IDs mismatch for "React": -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(2), ReferenceId(4), ReferenceId(8)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(2), ReferenceId(4), ReferenceId(10)] rebuilt : SymbolId(0): [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/compiler/reactSFCAndFunctionResolvable.tsx @@ -31404,10 +31473,10 @@ rebuilt : ["Checkbox", "OtherRadio", "Radio", "condition1", "condition2"] tasks/coverage/typescript/tests/cases/compiler/reactTagNameComponentWithPropsNoOOM.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["React", "Tag", "_jsxFileName", "children", "classes", "rest"] -rebuilt : ScopeId(0): ["React", "_jsxFileName", "children", "classes", "rest"] +after transform: ScopeId(0): ["React", "Tag", "_jsxFileName", "_objectSpread", "children", "classes", "rest"] +rebuilt : ScopeId(0): ["React", "_jsxFileName", "_objectSpread", "children", "classes", "rest"] Symbol reference IDs mismatch for "React": -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(7)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(9)] rebuilt : SymbolId(0): [ReferenceId(0)] Reference symbol mismatch for "Tag": after transform: SymbolId(1) "Tag" @@ -31418,10 +31487,10 @@ rebuilt : ["Tag"] tasks/coverage/typescript/tests/cases/compiler/reactTagNameComponentWithPropsNoOOM2.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["React", "Tag", "_jsxFileName", "children", "classes", "rest"] -rebuilt : ScopeId(0): ["React", "_jsxFileName", "children", "classes", "rest"] +after transform: ScopeId(0): ["React", "Tag", "_jsxFileName", "_objectSpread", "children", "classes", "rest"] +rebuilt : ScopeId(0): ["React", "_jsxFileName", "_objectSpread", "children", "classes", "rest"] Symbol reference IDs mismatch for "React": -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1), ReferenceId(9)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1), ReferenceId(11)] rebuilt : SymbolId(0): [ReferenceId(0)] Reference symbol mismatch for "Tag": after transform: SymbolId(1) "Tag" @@ -32642,14 +32711,14 @@ rebuilt : SymbolId(7): [] tasks/coverage/typescript/tests/cases/compiler/restParameterTypeInstantiation.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["TestGeneric", "removeF", "result"] -rebuilt : ScopeId(0): ["removeF", "result"] +after transform: ScopeId(0): ["TestGeneric", "_excluded", "_objectWithoutProperties", "removeF", "result"] +rebuilt : ScopeId(0): ["_excluded", "_objectWithoutProperties", "removeF", "result"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [ScopeId(1)] Bindings mismatch: -after transform: ScopeId(2): ["TX", "f", "rest"] -rebuilt : ScopeId(1): ["f", "rest"] +after transform: ScopeId(2): ["TX", "_ref", "f", "rest"] +rebuilt : ScopeId(1): ["_ref", "f", "rest"] tasks/coverage/typescript/tests/cases/compiler/restTypeRetainsMappyness.ts semantic error: Bindings mismatch: @@ -32664,17 +32733,23 @@ rebuilt : ScopeId(1): ["arr", "fn"] tasks/coverage/typescript/tests/cases/compiler/restUnion2.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["nullUnion", "rest2", "rest3", "undefinedUnion"] -rebuilt : ScopeId(0): ["rest2", "rest3"] +after transform: ScopeId(0): ["_extends", "_objectDestructuringEmpty", "nullUnion", "rest2", "rest3", "undefinedUnion"] +rebuilt : ScopeId(0): ["_extends", "_objectDestructuringEmpty", "rest2", "rest3"] +Reference symbol mismatch for "undefinedUnion": +after transform: SymbolId(0) "undefinedUnion" +rebuilt : Reference symbol mismatch for "undefinedUnion": after transform: SymbolId(0) "undefinedUnion" rebuilt : Reference symbol mismatch for "nullUnion": after transform: SymbolId(2) "nullUnion" rebuilt : +Reference symbol mismatch for "nullUnion": +after transform: SymbolId(2) "nullUnion" +rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["nullUnion", "undefinedUnion"] +after transform: ["require"] +rebuilt : ["nullUnion", "require", "undefinedUnion"] tasks/coverage/typescript/tests/cases/compiler/returnInfiniteIntersection.ts semantic error: Bindings mismatch: @@ -34917,8 +34992,8 @@ rebuilt : ["Array", "foo1", "foo2"] tasks/coverage/typescript/tests/cases/compiler/spreadExpressionContextualType.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Apple", "Orange", "test", "test2"] -rebuilt : ScopeId(0): ["test", "test2"] +after transform: ScopeId(0): ["Apple", "Orange", "_objectSpread", "test", "test2"] +rebuilt : ScopeId(0): ["_objectSpread", "test", "test2"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] @@ -34936,8 +35011,8 @@ rebuilt : ScopeId(1): ["thing"] tasks/coverage/typescript/tests/cases/compiler/spreadIdenticalTypesRemoved.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Animal", "Animal2", "billOwner", "clonePet"] -rebuilt : ScopeId(0): ["billOwner", "clonePet"] +after transform: ScopeId(0): ["Animal", "Animal2", "_objectSpread", "billOwner", "clonePet"] +rebuilt : ScopeId(0): ["_objectSpread", "billOwner", "clonePet"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] @@ -34952,25 +35027,25 @@ rebuilt : SymbolId(3): [] tasks/coverage/typescript/tests/cases/compiler/spreadObjectNoCircular1.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Box", "Foo", "b"] -rebuilt : ScopeId(0): ["Foo"] +after transform: ScopeId(0): ["Box", "Foo", "_objectSpread", "b"] +rebuilt : ScopeId(0): ["Foo", "_objectSpread"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [ScopeId(1)] Symbol reference IDs mismatch for "Foo": after transform: SymbolId(2): [ReferenceId(0), ReferenceId(3)] -rebuilt : SymbolId(0): [] +rebuilt : SymbolId(1): [] Reference symbol mismatch for "b": after transform: SymbolId(1) "b" rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["b"] +after transform: ["require"] +rebuilt : ["b", "require"] tasks/coverage/typescript/tests/cases/compiler/spreadObjectPermutations.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["a", "b", "c", "v_a", "v_ab", "v_abc", "v_ac", "v_acb", "v_b", "v_ba", "v_bac", "v_bc", "v_bca", "v_c", "v_ca", "v_cab", "v_cb", "v_cba"] -rebuilt : ScopeId(0): ["v_a", "v_ab", "v_abc", "v_ac", "v_acb", "v_b", "v_ba", "v_bac", "v_bc", "v_bca", "v_c", "v_ca", "v_cab", "v_cb", "v_cba"] +after transform: ScopeId(0): ["_objectSpread", "a", "b", "c", "v_a", "v_ab", "v_abc", "v_ac", "v_acb", "v_b", "v_ba", "v_bac", "v_bc", "v_bca", "v_c", "v_ca", "v_cab", "v_cb", "v_cba"] +rebuilt : ScopeId(0): ["_objectSpread", "v_a", "v_ab", "v_abc", "v_ac", "v_acb", "v_b", "v_ba", "v_bac", "v_bc", "v_bca", "v_c", "v_ca", "v_cab", "v_cb", "v_cba"] Reference symbol mismatch for "a": after transform: SymbolId(0) "a" rebuilt : @@ -35071,30 +35146,30 @@ Reference symbol mismatch for "a": after transform: SymbolId(0) "a" rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["a", "b", "c"] +after transform: ["require"] +rebuilt : ["a", "b", "c", "require"] tasks/coverage/typescript/tests/cases/compiler/spreadObjectWithIndexDoesNotAddUndefinedToLocalIndex.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["m", "x"] -rebuilt : ScopeId(0): ["x"] +after transform: ScopeId(0): ["_objectSpread", "m", "x"] +rebuilt : ScopeId(0): ["_objectSpread", "x"] Reference symbol mismatch for "m": after transform: SymbolId(0) "m" rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["m"] +after transform: ["require"] +rebuilt : ["m", "require"] tasks/coverage/typescript/tests/cases/compiler/spreadOfObjectLiteralAssignableToIndexSignature.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["RecordOfRecords", "RecordOfRecordsOrEmpty", "foo", "recordOfRecords", "recordsOfRecordsOrEmpty"] -rebuilt : ScopeId(0): ["foo", "recordOfRecords", "recordsOfRecordsOrEmpty"] +after transform: ScopeId(0): ["RecordOfRecords", "RecordOfRecordsOrEmpty", "_objectSpread", "foo", "recordOfRecords", "recordsOfRecordsOrEmpty"] +rebuilt : ScopeId(0): ["_objectSpread", "foo", "recordOfRecords", "recordsOfRecordsOrEmpty"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [] Unresolved references mismatch: -after transform: ["Record", "undefined"] -rebuilt : ["undefined"] +after transform: ["Record", "require", "undefined"] +rebuilt : ["require", "undefined"] tasks/coverage/typescript/tests/cases/compiler/spreadParameterTupleType.ts semantic error: Bindings mismatch: @@ -35117,8 +35192,8 @@ rebuilt : ScopeId(1): ["i", "rest", "singleton", "singletons"] tasks/coverage/typescript/tests/cases/compiler/spreadTypeRemovesReadonly.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["ReadonlyData", "clone", "data"] -rebuilt : ScopeId(0): ["clone", "data"] +after transform: ScopeId(0): ["ReadonlyData", "_objectSpread", "clone", "data"] +rebuilt : ScopeId(0): ["_objectSpread", "clone", "data"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] rebuilt : ScopeId(0): [] @@ -36387,14 +36462,14 @@ rebuilt : ScopeId(1): [] tasks/coverage/typescript/tests/cases/compiler/trivialSubtypeReductionNoStructuralCheck2.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Wizard", "WizardStepProps", "props"] -rebuilt : ScopeId(0): ["Wizard"] +after transform: ScopeId(0): ["Wizard", "WizardStepProps", "_objectSpread", "props"] +rebuilt : ScopeId(0): ["Wizard", "_objectSpread"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(3)] rebuilt : ScopeId(0): [ScopeId(1)] Symbol reference IDs mismatch for "Wizard": after transform: SymbolId(1): [ReferenceId(1), ReferenceId(4)] -rebuilt : SymbolId(0): [] +rebuilt : SymbolId(1): [] Reference symbol mismatch for "props": after transform: SymbolId(0) "props" rebuilt : @@ -36530,8 +36605,8 @@ rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] tasks/coverage/typescript/tests/cases/compiler/tsxUnionSpread.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["AnimalComponent", "AnimalInfo", "CatInfo", "DogInfo", "JSX", "_jsx", "_jsxFileName", "component", "component2", "getProps", "props", "props2"] -rebuilt : ScopeId(0): ["AnimalComponent", "_jsx", "_jsxFileName", "component", "component2", "getProps", "props", "props2"] +after transform: ScopeId(0): ["AnimalComponent", "AnimalInfo", "CatInfo", "DogInfo", "JSX", "_jsx", "_jsxFileName", "_objectSpread", "component", "component2", "getProps", "props", "props2"] +rebuilt : ScopeId(0): ["AnimalComponent", "_jsx", "_jsxFileName", "_objectSpread", "component", "component2", "getProps", "props", "props2"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] @@ -38158,8 +38233,8 @@ rebuilt : ScopeId(0): [ScopeId(1)] tasks/coverage/typescript/tests/cases/compiler/unionExcessPropsWithPartialMember.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["A", "B", "a", "ab"] -rebuilt : ScopeId(0): [] +after transform: ScopeId(0): ["A", "B", "_objectSpread", "a", "ab"] +rebuilt : ScopeId(0): ["_objectSpread"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [] @@ -38170,8 +38245,8 @@ Reference symbol mismatch for "a": after transform: SymbolId(3) "a" rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["a", "ab"] +after transform: ["require"] +rebuilt : ["a", "ab", "require"] tasks/coverage/typescript/tests/cases/compiler/unionOfArraysFilterCall.ts semantic error: Bindings mismatch: @@ -41004,37 +41079,73 @@ rebuilt : [] tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/thisAndSuperInStaticMembers1.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["C"] -rebuilt : ScopeId(0): ["C", "_this", "_this2"] +after transform: ScopeId(0): ["C", "_extends", "_objectDestructuringEmpty"] +rebuilt : ScopeId(0): ["C", "_extends", "_objectDestructuringEmpty", "_this", "_this2"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(4)] rebuilt : ScopeId(0): [ScopeId(1)] Bindings mismatch: -after transform: ScopeId(4): ["_this", "_this2"] +after transform: ScopeId(4): ["_this", "_this2", "_x"] rebuilt : ScopeId(1): [] Symbol scope ID mismatch for "_this": after transform: SymbolId(1): ScopeId(4) -rebuilt : SymbolId(0): ScopeId(0) +rebuilt : SymbolId(2): ScopeId(0) Symbol scope ID mismatch for "_this2": after transform: SymbolId(2): ScopeId(4) -rebuilt : SymbolId(1): ScopeId(0) +rebuilt : SymbolId(3): ScopeId(0) +Reference symbol mismatch for "_x": +after transform: SymbolId(3) "_x" +rebuilt : +Reference symbol mismatch for "_x": +after transform: SymbolId(3) "_x" +rebuilt : +Reference symbol mismatch for "_x": +after transform: SymbolId(3) "_x" +rebuilt : +Reference symbol mismatch for "_x": +after transform: SymbolId(3) "_x" +rebuilt : +Reference symbol mismatch for "_x": +after transform: SymbolId(3) "_x" +rebuilt : +Unresolved references mismatch: +after transform: ["B", "require", "undefined"] +rebuilt : ["B", "_x", "require", "undefined"] tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/thisAndSuperInStaticMembers2.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["C"] -rebuilt : ScopeId(0): ["C", "_this", "_this2"] +after transform: ScopeId(0): ["C", "_extends", "_objectDestructuringEmpty"] +rebuilt : ScopeId(0): ["C", "_extends", "_objectDestructuringEmpty", "_this", "_this2"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(4)] rebuilt : ScopeId(0): [ScopeId(1)] Bindings mismatch: -after transform: ScopeId(4): ["_this", "_this2"] +after transform: ScopeId(4): ["_this", "_this2", "_x"] rebuilt : ScopeId(1): [] Symbol scope ID mismatch for "_this": after transform: SymbolId(1): ScopeId(4) -rebuilt : SymbolId(0): ScopeId(0) +rebuilt : SymbolId(2): ScopeId(0) Symbol scope ID mismatch for "_this2": after transform: SymbolId(2): ScopeId(4) -rebuilt : SymbolId(1): ScopeId(0) +rebuilt : SymbolId(3): ScopeId(0) +Reference symbol mismatch for "_x": +after transform: SymbolId(3) "_x" +rebuilt : +Reference symbol mismatch for "_x": +after transform: SymbolId(3) "_x" +rebuilt : +Reference symbol mismatch for "_x": +after transform: SymbolId(3) "_x" +rebuilt : +Reference symbol mismatch for "_x": +after transform: SymbolId(3) "_x" +rebuilt : +Reference symbol mismatch for "_x": +after transform: SymbolId(3) "_x" +rebuilt : +Unresolved references mismatch: +after transform: ["B", "require", "undefined"] +rebuilt : ["B", "_x", "require", "undefined"] tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/thisAndSuperInStaticMembers3.ts semantic error: Bindings mismatch: @@ -44418,6 +44529,11 @@ Unresolved references mismatch: after transform: [] rebuilt : ["yadda"] +tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringObjectAssignmentPatternWithNestedSpread.ts +semantic error: Reference flags mismatch for "a": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(6): ReferenceFlags(Read | Write) + tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES5.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["F", "F1", "a1", "a2", "b1", "b21", "b3", "b4", "b52", "bar", "c0", "c1", "d1", "foo", "foo1"] @@ -44434,6 +44550,11 @@ Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3)] +tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment5.ts +semantic error: Reference flags mismatch for "x": +after transform: ReferenceId(0): ReferenceFlags(Write) +rebuilt : ReferenceId(2): ReferenceFlags(Read | Write) + tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment7.ts semantic error: Bindings mismatch: after transform: ScopeId(1): ["K", "a", "b"] @@ -44758,8 +44879,8 @@ rebuilt : [] tasks/coverage/typescript/tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Stuff", "T", "a", "b", "c", "obj"] -rebuilt : ScopeId(0): ["a", "b", "c"] +after transform: ScopeId(0): ["Stuff", "T", "_objectSpread", "a", "b", "c", "obj"] +rebuilt : ScopeId(0): ["_objectSpread", "a", "b", "c"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7), ScopeId(8), ScopeId(9), ScopeId(10), ScopeId(11)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7), ScopeId(8)] @@ -50238,6 +50359,17 @@ semantic error: Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [ScopeId(1)] +tasks/coverage/typescript/tests/cases/conformance/functions/functionParameterObjectRestAndInitializers.ts +semantic error: Symbol reference IDs mismatch for "a": +after transform: SymbolId(1): [ReferenceId(0)] +rebuilt : SymbolId(6): [] +Reference symbol mismatch for "a": +after transform: SymbolId(1) "a" +rebuilt : +Unresolved references mismatch: +after transform: ["require"] +rebuilt : ["a", "require"] + tasks/coverage/typescript/tests/cases/conformance/functions/strictBindCallApply2.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["Foo", "Test", "fb", "fn"] @@ -51929,23 +52061,23 @@ tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxChildrenProperty12 semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Bindings mismatch: -after transform: ScopeId(0): ["Button", "ButtonProp", "InnerButton", "InnerButtonProp", "React", "_jsxFileName", "_reactJsxRuntime"] -rebuilt : ScopeId(0): ["Button", "InnerButton", "React", "_jsxFileName", "_reactJsxRuntime"] +after transform: ScopeId(0): ["Button", "ButtonProp", "InnerButton", "InnerButtonProp", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime"] +rebuilt : ScopeId(0): ["Button", "InnerButton", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(6), ScopeId(7)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(5)] Symbol reference IDs mismatch for "Button": after transform: SymbolId(2): [ReferenceId(0)] -rebuilt : SymbolId(3): [] +rebuilt : SymbolId(4): [] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(17)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(20), ReferenceId(21)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxChildrenProperty16.tsx semantic error: Missing SymbolId: "React" @@ -52108,14 +52240,14 @@ rebuilt : ["React"] tasks/coverage/typescript/tests/cases/conformance/jsx/jsxReactTestSuite.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Child", "Component", "Composite", "Composite2", "Namespace", "React", "_jsxFileName", "_reactJsxRuntime", "bar", "foo", "hasOwnProperty", "x", "y", "z"] -rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime", "x"] +after transform: ScopeId(0): ["Child", "Component", "Composite", "Composite2", "Namespace", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "bar", "foo", "hasOwnProperty", "x", "y", "z"] +rebuilt : ScopeId(0): ["_jsxFileName", "_objectSpread", "_reactJsxRuntime", "x"] Symbol span mismatch for "x": after transform: SymbolId(9): Span { start: 231, end: 236 } -rebuilt : SymbolId(2): Span { start: 537, end: 538 } +rebuilt : SymbolId(3): Span { start: 537, end: 538 } Symbol redeclarations mismatch for "x": after transform: SymbolId(9): [Span { start: 537, end: 538 }] -rebuilt : SymbolId(2): [] +rebuilt : SymbolId(3): [] Reference symbol mismatch for "Component": after transform: SymbolId(1) "Component" rebuilt : @@ -52226,8 +52358,8 @@ rebuilt : ["require"] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxAttributeResolution8.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["JSX", "_jsxFileName", "_reactJsxRuntime", "x"] -rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime", "x"] +after transform: ScopeId(0): ["JSX", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "x"] +rebuilt : ScopeId(0): ["_jsxFileName", "_objectSpread", "_reactJsxRuntime", "x"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] rebuilt : ScopeId(0): [] @@ -52387,16 +52519,16 @@ rebuilt : ScopeId(0): [ScopeId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxEmit2.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["JSX", "_jsxFileName", "_reactJsxRuntime", "p1", "p2", "p3", "spreads1", "spreads2", "spreads3", "spreads4", "spreads5"] -rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime", "p1", "p2", "p3", "spreads1", "spreads2", "spreads3", "spreads4", "spreads5"] +after transform: ScopeId(0): ["JSX", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "p1", "p2", "p3", "spreads1", "spreads2", "spreads3", "spreads4", "spreads5"] +rebuilt : ScopeId(0): ["_jsxFileName", "_objectSpread", "_reactJsxRuntime", "p1", "p2", "p3", "spreads1", "spreads2", "spreads3", "spreads4", "spreads5"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] rebuilt : ScopeId(0): [] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxEmitSpreadAttribute.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["React", "T1", "T10", "T11", "T2", "T3", "T4", "T5", "T6", "T7", "T8", "T9", "__proto__", "_jsxFileName"] -rebuilt : ScopeId(0): ["T1", "T10", "T11", "T2", "T3", "T4", "T5", "T6", "T7", "T8", "T9", "_jsxFileName"] +after transform: ScopeId(0): ["React", "T1", "T10", "T11", "T2", "T3", "T4", "T5", "T6", "T7", "T8", "T9", "__proto__", "_jsxFileName", "_objectSpread"] +rebuilt : ScopeId(0): ["T1", "T10", "T11", "T2", "T3", "T4", "T5", "T6", "T7", "T8", "T9", "_jsxFileName", "_objectSpread"] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" rebuilt : @@ -52549,8 +52681,8 @@ tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType1. semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(5), SymbolId(9), SymbolId(14), SymbolId(15)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(6), SymbolId(9)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(5), SymbolId(9), SymbolId(14), SymbolId(15), SymbolId(16)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(7), SymbolId(10)] Bindings mismatch: after transform: ScopeId(1): ["Component", "T"] rebuilt : ScopeId(1): ["Component"] @@ -52561,28 +52693,28 @@ Bindings mismatch: after transform: ScopeId(5): ["Component", "T", "U"] rebuilt : ScopeId(5): ["Component"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(27)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(31), ReferenceId(32)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType2.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(5), SymbolId(6)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(5), SymbolId(6), SymbolId(7)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4)] Bindings mismatch: after transform: ScopeId(1): ["Component", "T"] rebuilt : ScopeId(1): ["Component"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(9)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(11), ReferenceId(12)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType3.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(5), SymbolId(6)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(5), SymbolId(6), SymbolId(7)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5)] Bindings mismatch: after transform: ScopeId(1): ["T"] rebuilt : ScopeId(1): [] @@ -52591,20 +52723,20 @@ after transform: ScopeId(3): ["U"] rebuilt : ScopeId(3): [] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(9)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(11), ReferenceId(12)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType4.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(5), SymbolId(6)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(5), SymbolId(6), SymbolId(7)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5)] Bindings mismatch: after transform: ScopeId(1): ["T"] rebuilt : ScopeId(1): [] @@ -52613,20 +52745,20 @@ after transform: ScopeId(3): ["U"] rebuilt : ScopeId(3): [] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(9)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(11), ReferenceId(12)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType5.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(5), SymbolId(6)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(5), SymbolId(6), SymbolId(7)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5)] Bindings mismatch: after transform: ScopeId(1): ["T"] rebuilt : ScopeId(1): [] @@ -52635,20 +52767,20 @@ after transform: ScopeId(3): ["U"] rebuilt : ScopeId(3): [] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(10)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(12), ReferenceId(13)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType6.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(5), SymbolId(6)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(5), SymbolId(6), SymbolId(7)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5)] Bindings mismatch: after transform: ScopeId(1): ["T"] rebuilt : ScopeId(1): [] @@ -52657,20 +52789,20 @@ after transform: ScopeId(3): ["U"] rebuilt : ScopeId(3): [] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(10)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(12), ReferenceId(13)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType7.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(3), SymbolId(6), SymbolId(9), SymbolId(10)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(5)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(3), SymbolId(6), SymbolId(9), SymbolId(10), SymbolId(11)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(6)] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] @@ -52684,15 +52816,15 @@ Unresolved references mismatch: after transform: ["Component", "JSX", "require"] rebuilt : ["Component", "require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(12)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(15), ReferenceId(16)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType8.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(3), SymbolId(6), SymbolId(9), SymbolId(10)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(5)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(3), SymbolId(6), SymbolId(9), SymbolId(10), SymbolId(11)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(6)] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] @@ -52706,21 +52838,21 @@ Unresolved references mismatch: after transform: ["Component", "JSX", "require"] rebuilt : ["Component", "require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(12)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(14), ReferenceId(15)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType9.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(4), SymbolId(5)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(4), SymbolId(5), SymbolId(6)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4)] Bindings mismatch: after transform: ScopeId(1): ["Ctor", "P"] rebuilt : ScopeId(1): ["Ctor"] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved references mismatch: after transform: ["JSX"] rebuilt : ["require"] @@ -52884,8 +53016,8 @@ rebuilt : ["React"] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxReactEmit2.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["JSX", "React", "_jsxFileName", "p1", "p2", "p3", "spreads1", "spreads2", "spreads3", "spreads4", "spreads5"] -rebuilt : ScopeId(0): ["_jsxFileName", "p1", "p2", "p3", "spreads1", "spreads2", "spreads3", "spreads4", "spreads5"] +after transform: ScopeId(0): ["JSX", "React", "_jsxFileName", "_objectSpread", "p1", "p2", "p3", "spreads1", "spreads2", "spreads3", "spreads4", "spreads5"] +rebuilt : ScopeId(0): ["_jsxFileName", "_objectSpread", "p1", "p2", "p3", "spreads1", "spreads2", "spreads3", "spreads4", "spreads5"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] rebuilt : ScopeId(0): [] @@ -53007,8 +53139,8 @@ rebuilt : ScopeId(0): ["_jsxFileName", "render"] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxReactEmitSpreadAttribute.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["T1", "T10", "T11", "T12", "T2", "T3", "T4", "T5", "T6", "T7", "T8", "T9", "__proto__", "_jsx", "_jsxFileName"] -rebuilt : ScopeId(0): ["T1", "T10", "T11", "T12", "T2", "T3", "T4", "T5", "T6", "T7", "T8", "T9", "_jsx", "_jsxFileName"] +after transform: ScopeId(0): ["T1", "T10", "T11", "T12", "T2", "T3", "T4", "T5", "T6", "T7", "T8", "T9", "__proto__", "_jsx", "_jsxFileName", "_objectSpread"] +rebuilt : ScopeId(0): ["T1", "T10", "T11", "T12", "T2", "T3", "T4", "T5", "T6", "T7", "T8", "T9", "_jsx", "_jsxFileName", "_objectSpread"] Reference symbol mismatch for "__proto__": after transform: SymbolId(36) "__proto__" rebuilt : @@ -53116,40 +53248,40 @@ tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolut semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5), SymbolId(6)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5), SymbolId(6)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5), SymbolId(6), SymbolId(7)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5), SymbolId(6), SymbolId(7)] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(10)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(11), ReferenceId(12)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution11.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Bindings mismatch: -after transform: ScopeId(0): ["OverWriteAttr", "Prop", "React", "_jsxFileName", "_reactJsxRuntime", "anyobj", "obj", "obj1", "obj3", "x", "x1", "x2", "x3", "x4", "x5"] -rebuilt : ScopeId(0): ["OverWriteAttr", "React", "_jsxFileName", "_reactJsxRuntime", "anyobj", "obj", "obj1", "obj3", "x", "x1", "x2", "x3", "x4", "x5"] +after transform: ScopeId(0): ["OverWriteAttr", "Prop", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "anyobj", "obj", "obj1", "obj3", "x", "x1", "x2", "x3", "x4", "x5"] +rebuilt : ScopeId(0): ["OverWriteAttr", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "anyobj", "obj", "obj1", "obj3", "x", "x1", "x2", "x3", "x4", "x5"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [ScopeId(1)] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved references mismatch: after transform: ["require", "true"] rebuilt : ["require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(31)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(40), ReferenceId(41)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution13.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Bindings mismatch: -after transform: ScopeId(0): ["AnotherComponentProps", "ChildComponent", "Component", "ComponentProps", "React", "_jsx", "_jsxFileName"] -rebuilt : ScopeId(0): ["ChildComponent", "Component", "React", "_jsx", "_jsxFileName"] +after transform: ScopeId(0): ["AnotherComponentProps", "ChildComponent", "Component", "ComponentProps", "React", "_jsx", "_jsxFileName", "_objectSpread"] +rebuilt : ScopeId(0): ["ChildComponent", "Component", "React", "_jsx", "_jsxFileName", "_objectSpread"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(5), ScopeId(6)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(4)] @@ -53161,8 +53293,8 @@ tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolut semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Bindings mismatch: -after transform: ScopeId(0): ["AnotherComponent", "AnotherComponentProps", "Component", "ComponentProps", "React", "_jsx", "_jsxFileName"] -rebuilt : ScopeId(0): ["AnotherComponent", "Component", "React", "_jsx", "_jsxFileName"] +after transform: ScopeId(0): ["AnotherComponent", "AnotherComponentProps", "Component", "ComponentProps", "React", "_jsx", "_jsxFileName", "_objectSpread"] +rebuilt : ScopeId(0): ["AnotherComponent", "Component", "React", "_jsx", "_jsxFileName", "_objectSpread"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] @@ -53174,68 +53306,68 @@ tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolut semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Bindings mismatch: -after transform: ScopeId(0): ["Poisoned", "PoisonedProp", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "p", "y"] -rebuilt : ScopeId(0): ["Poisoned", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "p", "y"] +after transform: ScopeId(0): ["Poisoned", "PoisonedProp", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "obj", "p", "y"] +rebuilt : ScopeId(0): ["Poisoned", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "obj", "p", "y"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [ScopeId(1)] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(11)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(12), ReferenceId(13)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution7.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Bindings mismatch: -after transform: ScopeId(0): ["React", "TextComponent", "TextProps", "_jsxFileName", "_reactJsxRuntime", "textPropsFalse", "textPropsTrue", "y1", "y2"] -rebuilt : ScopeId(0): ["React", "TextComponent", "_jsxFileName", "_reactJsxRuntime", "textPropsFalse", "textPropsTrue", "y1", "y2"] +after transform: ScopeId(0): ["React", "TextComponent", "TextProps", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "textPropsFalse", "textPropsTrue", "y1", "y2"] +rebuilt : ScopeId(0): ["React", "TextComponent", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "textPropsFalse", "textPropsTrue", "y1", "y2"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(4)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(3)] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved references mismatch: after transform: ["require", "true"] rebuilt : ["require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(15)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(17), ReferenceId(18)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution8.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Bindings mismatch: -after transform: ScopeId(0): ["OverWriteAttr", "Prop", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "obj1", "obj3", "x", "x1"] -rebuilt : ScopeId(0): ["OverWriteAttr", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "obj1", "obj3", "x", "x1"] +after transform: ScopeId(0): ["OverWriteAttr", "Prop", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "obj", "obj1", "obj3", "x", "x1"] +rebuilt : ScopeId(0): ["OverWriteAttr", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "obj", "obj1", "obj3", "x", "x1"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [ScopeId(1)] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(14)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(18), ReferenceId(19)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution9.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Bindings mismatch: -after transform: ScopeId(0): ["Opt", "OptionProp", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "obj1", "p", "y", "y1", "y2", "y3"] -rebuilt : ScopeId(0): ["Opt", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "obj1", "p", "y", "y1", "y2", "y3"] +after transform: ScopeId(0): ["Opt", "OptionProp", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "obj", "obj1", "p", "y", "y1", "y2", "y3"] +rebuilt : ScopeId(0): ["Opt", "React", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "obj", "obj1", "p", "y", "y1", "y2", "y3"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [ScopeId(1)] Reference symbol mismatch for "React": after transform: SymbolId(0) "React" -rebuilt : SymbolId(2) "React" +rebuilt : SymbolId(3) "React" Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(24)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(28), ReferenceId(29)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadChildren.tsx semantic error: Spread children are not supported in React. @@ -53248,8 +53380,8 @@ tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionCompon semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5), SymbolId(6), SymbolId(7), SymbolId(8), SymbolId(9), SymbolId(10), SymbolId(11), SymbolId(12), SymbolId(13), SymbolId(14), SymbolId(15), SymbolId(16), SymbolId(17)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5), SymbolId(6), SymbolId(7), SymbolId(8), SymbolId(9), SymbolId(10), SymbolId(11), SymbolId(12), SymbolId(13), SymbolId(14), SymbolId(15), SymbolId(16)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5), SymbolId(6), SymbolId(7), SymbolId(8), SymbolId(9), SymbolId(10), SymbolId(11), SymbolId(12), SymbolId(13), SymbolId(14), SymbolId(15), SymbolId(16), SymbolId(17), SymbolId(18)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5), SymbolId(6), SymbolId(7), SymbolId(8), SymbolId(9), SymbolId(10), SymbolId(11), SymbolId(12), SymbolId(13), SymbolId(14), SymbolId(15), SymbolId(16), SymbolId(17)] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [] @@ -53257,13 +53389,13 @@ Unresolved references mismatch: after transform: ["JSX", "OneThing", "require"] rebuilt : ["OneThing", "require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(40)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(51), ReferenceId(52)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload3.tsx semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Context", "_jsxFileName", "_reactJsxRuntime", "obj2", "three1", "three2", "three3", "two1", "two2", "two3", "two4", "two5"] -rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime", "obj2", "three1", "three2", "three3", "two1", "two2", "two3", "two4", "two5"] +after transform: ScopeId(0): ["Context", "_jsxFileName", "_objectSpread", "_reactJsxRuntime", "obj2", "three1", "three2", "three3", "two1", "two2", "two3", "two4", "two5"] +rebuilt : ScopeId(0): ["_jsxFileName", "_objectSpread", "_reactJsxRuntime", "obj2", "three1", "three2", "three3", "two1", "two2", "two3", "two4", "two5"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6)] rebuilt : ScopeId(0): [] @@ -53275,8 +53407,8 @@ tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionCompon semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Bindings mismatch: -after transform: ScopeId(0): ["ButtonProps", "ClickableProps", "HyphenProps", "LinkProps", "MainButton", "React", "_jsx", "_jsxFileName", "b0", "b1", "b10", "b11", "b12", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "obj", "obj1", "obj2"] -rebuilt : ScopeId(0): ["MainButton", "React", "_jsx", "_jsxFileName", "b0", "b1", "b10", "b11", "b12", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "obj", "obj1", "obj2"] +after transform: ScopeId(0): ["ButtonProps", "ClickableProps", "HyphenProps", "LinkProps", "MainButton", "React", "_jsx", "_jsxFileName", "_objectSpread", "b0", "b1", "b10", "b11", "b12", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "obj", "obj1", "obj2"] +rebuilt : ScopeId(0): ["MainButton", "React", "_jsx", "_jsxFileName", "_objectSpread", "b0", "b1", "b10", "b11", "b12", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "obj", "obj1", "obj2"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7), ScopeId(8), ScopeId(9), ScopeId(11), ScopeId(12), ScopeId(13), ScopeId(14)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7)] @@ -53333,8 +53465,8 @@ tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionCompon semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(7), SymbolId(23), SymbolId(29), SymbolId(30)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(13)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(7), SymbolId(23), SymbolId(29), SymbolId(30), SymbolId(31)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(14)] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] @@ -53345,15 +53477,15 @@ Unresolved references mismatch: after transform: ["JSX", "Link", "OverloadComponent", "require"] rebuilt : ["Link", "OverloadComponent", "require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(48)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(59), ReferenceId(60)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments5.tsx semantic error: Missing SymbolId: "React" Missing ReferenceId: "require" Binding symbols mismatch: -after transform: ScopeId(0): [SymbolId(0), SymbolId(3), SymbolId(12), SymbolId(19), SymbolId(20)] -rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(7)] +after transform: ScopeId(0): [SymbolId(0), SymbolId(3), SymbolId(12), SymbolId(19), SymbolId(20), SymbolId(21)] +rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(8)] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2)] @@ -53367,8 +53499,8 @@ Unresolved references mismatch: after transform: ["Component", "ComponentSpecific", "ComponentSpecific1", "JSX", "require"] rebuilt : ["Component", "ComponentSpecific", "ComponentSpecific1", "require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(32)] -rebuilt : [ReferenceId(0), ReferenceId(1)] +after transform: [ReferenceId(43), ReferenceId(44)] +rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.tsx semantic error: Missing SymbolId: "React" @@ -55671,8 +55803,8 @@ rebuilt : SymbolId(0): [ReferenceId(7), ReferenceId(52), ReferenceId(54), tasks/coverage/typescript/tests/cases/conformance/types/literal/literalTypeWidening.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["E", "FAILURE", "LangCode", "Obj", "Result", "Set", "TestEvent", "a", "arr", "b", "doWork", "f1", "f2", "f3", "f4", "f5", "f6", "increment", "isFailure", "isSuccess", "keys", "langCodeSet", "langCodes", "onMouseOver", "result", "test", "x"] -rebuilt : ScopeId(0): ["E", "FAILURE", "Set", "a", "arr", "b", "doWork", "f1", "f2", "f3", "f4", "f5", "f6", "increment", "isFailure", "isSuccess", "keys", "langCodeSet", "langCodes", "onMouseOver", "result", "test", "x"] +after transform: ScopeId(0): ["E", "FAILURE", "LangCode", "Obj", "Result", "Set", "TestEvent", "_excluded", "_objectSpread", "_objectWithoutProperties", "a", "arr", "b", "doWork", "f1", "f2", "f3", "f4", "f5", "f6", "increment", "isFailure", "isSuccess", "keys", "langCodeSet", "langCodes", "onMouseOver", "result", "test", "x"] +rebuilt : ScopeId(0): ["E", "FAILURE", "Set", "_excluded", "_objectSpread", "_objectWithoutProperties", "a", "arr", "b", "doWork", "f1", "f2", "f3", "f4", "f5", "f6", "increment", "isFailure", "isSuccess", "keys", "langCodeSet", "langCodes", "onMouseOver", "result", "test", "x"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7), ScopeId(8), ScopeId(9), ScopeId(10), ScopeId(11), ScopeId(12), ScopeId(13), ScopeId(14), ScopeId(15), ScopeId(16), ScopeId(17), ScopeId(18), ScopeId(20), ScopeId(21), ScopeId(22), ScopeId(23), ScopeId(24), ScopeId(25), ScopeId(26)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7), ScopeId(8), ScopeId(9), ScopeId(10), ScopeId(11), ScopeId(12), ScopeId(13), ScopeId(15), ScopeId(16), ScopeId(17), ScopeId(18)] @@ -55702,25 +55834,25 @@ after transform: ScopeId(26): ScopeFlags(StrictMode) rebuilt : ScopeId(18): ScopeFlags(StrictMode | Function) Symbol flags mismatch for "FAILURE": after transform: SymbolId(63): SymbolFlags(BlockScopedVariable | ConstVariable | TypeAlias) -rebuilt : SymbolId(59): SymbolFlags(BlockScopedVariable | ConstVariable) +rebuilt : SymbolId(62): SymbolFlags(BlockScopedVariable | ConstVariable) Symbol span mismatch for "FAILURE": after transform: SymbolId(63): Span { start: 2229, end: 2236 } -rebuilt : SymbolId(59): Span { start: 2256, end: 2263 } +rebuilt : SymbolId(62): Span { start: 2256, end: 2263 } Symbol reference IDs mismatch for "FAILURE": after transform: SymbolId(63): [ReferenceId(55), ReferenceId(58), ReferenceId(66), ReferenceId(68)] -rebuilt : SymbolId(59): [ReferenceId(50), ReferenceId(54)] +rebuilt : SymbolId(62): [ReferenceId(50), ReferenceId(54)] Symbol redeclarations mismatch for "FAILURE": after transform: SymbolId(63): [Span { start: 2256, end: 2263 }] -rebuilt : SymbolId(59): [] +rebuilt : SymbolId(62): [] Symbol reference IDs mismatch for "langCodeSet": after transform: SymbolId(90): [ReferenceId(97), ReferenceId(99)] -rebuilt : SymbolId(76): [ReferenceId(70)] +rebuilt : SymbolId(79): [ReferenceId(70)] Symbol flags mismatch for "E": after transform: SymbolId(102): SymbolFlags(RegularEnum) -rebuilt : SymbolId(84): SymbolFlags(FunctionScopedVariable) +rebuilt : SymbolId(87): SymbolFlags(FunctionScopedVariable) Symbol reference IDs mismatch for "E": -after transform: SymbolId(102): [ReferenceId(112), ReferenceId(113), ReferenceId(120)] -rebuilt : SymbolId(84): [ReferenceId(80), ReferenceId(82)] +after transform: SymbolId(102): [ReferenceId(112), ReferenceId(113), ReferenceId(124)] +rebuilt : SymbolId(87): [ReferenceId(84), ReferenceId(86)] Unresolved references mismatch: after transform: ["NonNullable", "Object", "Record", "f", "nonWidening", "true", "widening"] rebuilt : ["Object", "f", "nonWidening", "widening"] @@ -56157,8 +56289,8 @@ rebuilt : ["applySpec", "clone", "f20", "f21", "f22", "f23", "f24", "vali tasks/coverage/typescript/tests/cases/conformance/types/mapped/mappedTypeConstraints.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["TargetProps", "f0", "f1", "f2", "f3", "f4", "modifier"] -rebuilt : ScopeId(0): ["f0", "f1", "f2", "f3", "f4", "modifier"] +after transform: ScopeId(0): ["TargetProps", "_excluded", "_objectWithoutProperties", "f0", "f1", "f2", "f3", "f4", "modifier"] +rebuilt : ScopeId(0): ["_excluded", "_objectWithoutProperties", "f0", "f1", "f2", "f3", "f4", "modifier"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6)] @@ -56181,8 +56313,8 @@ Bindings mismatch: after transform: ScopeId(7): ["T", "bar", "rest", "targetProps"] rebuilt : ScopeId(6): ["bar", "rest", "targetProps"] Unresolved references mismatch: -after transform: ["Exclude", "Extract", "Pick", "Record"] -rebuilt : [] +after transform: ["Exclude", "Extract", "Pick", "Record", "require"] +rebuilt : ["require"] tasks/coverage/typescript/tests/cases/conformance/types/mapped/mappedTypeIndexSignatureModifiers.ts semantic error: Bindings mismatch: @@ -57046,8 +57178,8 @@ rebuilt : [ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/types/rest/genericObjectRest.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Item", "a", "f1", "f2", "f3", "f4", "sa", "sb"] -rebuilt : ScopeId(0): ["a", "f1", "f2", "f3", "f4", "sa", "sb"] +after transform: ScopeId(0): ["Item", "_excluded", "_excluded2", "_excluded3", "_excluded4", "_extends", "_objectDestructuringEmpty", "_objectWithoutProperties", "_toPropertyKey", "a", "f1", "f2", "f3", "f4", "sa", "sb"] +rebuilt : ScopeId(0): ["_excluded", "_excluded2", "_excluded3", "_excluded4", "_extends", "_objectDestructuringEmpty", "_objectWithoutProperties", "_toPropertyKey", "a", "f1", "f2", "f3", "f4", "sa", "sb"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4)] @@ -57064,11 +57196,11 @@ Bindings mismatch: after transform: ScopeId(5): ["K1", "K2", "a1", "a2", "k1", "k2", "obj", "r1"] rebuilt : ScopeId(4): ["a1", "a2", "k1", "k2", "obj", "r1"] Symbol reference IDs mismatch for "sa": -after transform: SymbolId(16): [ReferenceId(10), ReferenceId(13)] -rebuilt : SymbolId(15): [ReferenceId(9)] +after transform: SymbolId(16): [ReferenceId(10), ReferenceId(13), ReferenceId(51)] +rebuilt : SymbolId(23): [ReferenceId(32), ReferenceId(37)] Symbol reference IDs mismatch for "sb": -after transform: SymbolId(17): [ReferenceId(11), ReferenceId(14)] -rebuilt : SymbolId(16): [ReferenceId(10)] +after transform: SymbolId(17): [ReferenceId(11), ReferenceId(14), ReferenceId(52)] +rebuilt : SymbolId(24): [ReferenceId(33), ReferenceId(38)] tasks/coverage/typescript/tests/cases/conformance/types/rest/genericRestParameters2.ts semantic error: Bindings mismatch: @@ -57338,6 +57470,23 @@ semantic error: Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [ScopeId(1)] +tasks/coverage/typescript/tests/cases/conformance/types/rest/objectRestForOf.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["_excluded", "_excluded2", "_objectSpread", "_objectWithoutProperties", "array", "rrestOff", "xx"] +rebuilt : ScopeId(0): ["_excluded", "_excluded2", "_objectSpread", "_objectWithoutProperties", "_ref2", "_ref3", "array", "rrestOff", "xx"] +Bindings mismatch: +after transform: ScopeId(3): ["_ref2"] +rebuilt : ScopeId(3): [] +Bindings mismatch: +after transform: ScopeId(4): ["_ref3"] +rebuilt : ScopeId(4): [] +Symbol scope ID mismatch for "_ref2": +after transform: SymbolId(10): ScopeId(3) +rebuilt : SymbolId(10): ScopeId(0) +Symbol scope ID mismatch for "_ref3": +after transform: SymbolId(11): ScopeId(4) +rebuilt : SymbolId(11): ScopeId(0) + tasks/coverage/typescript/tests/cases/conformance/types/rest/objectRestParameter.ts semantic error: Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(8)] @@ -57350,14 +57499,14 @@ rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), Sc tasks/coverage/typescript/tests/cases/conformance/types/rest/objectRestReadonly.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["ObjType", "foo", "obj", "rest"] -rebuilt : ScopeId(0): ["foo", "obj", "rest"] +after transform: ScopeId(0): ["ObjType", "_objectWithoutProperties", "foo", "obj", "rest"] +rebuilt : ScopeId(0): ["_objectWithoutProperties", "foo", "obj", "rest"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] rebuilt : ScopeId(0): [] Unresolved references mismatch: -after transform: ["Readonly"] -rebuilt : [] +after transform: ["Readonly", "require"] +rebuilt : ["require"] tasks/coverage/typescript/tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayOfFunctionTypes3.ts semantic error: Bindings mismatch: @@ -57486,8 +57635,8 @@ rebuilt : [] tasks/coverage/typescript/tests/cases/conformance/types/spread/objectSpread.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["C", "Header", "a", "addAfter", "addBefore", "anything", "c", "changeTypeAfter", "changeTypeBoth", "combined", "combinedAfter", "combinedNestedChangeType", "conditionalSpreadBoolean", "conditionalSpreadNumber", "conditionalSpreadString", "container", "cplus", "exclusive", "f", "from16326", "genericSpread", "getter", "nested", "o", "o2", "op", "overlap", "overlapConflict", "override", "overwriteId", "propertyNested", "shortCutted", "spreadAny", "spreadC", "spreadFunc", "spreadNonPrimitive", "swap"] -rebuilt : ScopeId(0): ["C", "a", "addAfter", "addBefore", "anything", "c", "changeTypeAfter", "changeTypeBoth", "combined", "combinedAfter", "combinedNestedChangeType", "conditionalSpreadBoolean", "conditionalSpreadNumber", "conditionalSpreadString", "container", "cplus", "exclusive", "f", "from16326", "genericSpread", "getter", "nested", "o", "o2", "op", "overlap", "overlapConflict", "override", "overwriteId", "propertyNested", "shortCutted", "spreadAny", "spreadC", "spreadFunc", "spreadNonPrimitive", "swap"] +after transform: ScopeId(0): ["C", "Header", "_objectSpread", "a", "addAfter", "addBefore", "anything", "c", "changeTypeAfter", "changeTypeBoth", "combined", "combinedAfter", "combinedNestedChangeType", "conditionalSpreadBoolean", "conditionalSpreadNumber", "conditionalSpreadString", "container", "cplus", "exclusive", "f", "from16326", "genericSpread", "getter", "nested", "o", "o2", "op", "overlap", "overlapConflict", "override", "overwriteId", "propertyNested", "shortCutted", "spreadAny", "spreadC", "spreadFunc", "spreadNonPrimitive", "swap"] +rebuilt : ScopeId(0): ["C", "_objectSpread", "a", "addAfter", "addBefore", "anything", "c", "changeTypeAfter", "changeTypeBoth", "combined", "combinedAfter", "combinedNestedChangeType", "conditionalSpreadBoolean", "conditionalSpreadNumber", "conditionalSpreadString", "container", "cplus", "exclusive", "f", "from16326", "genericSpread", "getter", "nested", "o", "o2", "op", "overlap", "overlapConflict", "override", "overwriteId", "propertyNested", "shortCutted", "spreadAny", "spreadC", "spreadFunc", "spreadNonPrimitive", "swap"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7), ScopeId(8), ScopeId(10), ScopeId(11), ScopeId(12), ScopeId(13), ScopeId(14)] rebuilt : ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7), ScopeId(9), ScopeId(10), ScopeId(11), ScopeId(12)] @@ -57499,28 +57648,33 @@ after transform: ScopeId(14): ["T", "U", "obj", "t", "u", "v", "w", "x01", "x02" rebuilt : ScopeId(12): ["obj", "t", "u", "v", "w", "x01", "x02", "x03", "x04", "x05", "x06", "x07", "x09", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18"] Symbol reference IDs mismatch for "C": after transform: SymbolId(32): [ReferenceId(36), ReferenceId(37)] -rebuilt : SymbolId(31): [ReferenceId(33)] +rebuilt : SymbolId(32): [ReferenceId(67)] + +tasks/coverage/typescript/tests/cases/conformance/types/spread/objectSpreadNoTransform.ts +semantic error: Reference flags mismatch for "b": +after transform: ReferenceId(1): ReferenceFlags(Write) +rebuilt : ReferenceId(6): ReferenceFlags(Read | Write) tasks/coverage/typescript/tests/cases/conformance/types/spread/objectSpreadRepeatedComplexity.ts semantic error: Unresolved references mismatch: -after transform: ["Record"] -rebuilt : [] +after transform: ["Record", "require"] +rebuilt : ["require"] tasks/coverage/typescript/tests/cases/conformance/types/spread/objectSpreadRepeatedNullCheckPerf.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Props", "parseWithSpread"] -rebuilt : ScopeId(0): ["parseWithSpread"] +after transform: ScopeId(0): ["Props", "_objectSpread", "parseWithSpread"] +rebuilt : ScopeId(0): ["_objectSpread", "parseWithSpread"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [ScopeId(1)] Unresolved references mismatch: -after transform: ["Record", "undefined"] -rebuilt : ["undefined"] +after transform: ["Record", "require", "undefined"] +rebuilt : ["require", "undefined"] tasks/coverage/typescript/tests/cases/conformance/types/spread/spreadContextualTypedBindingPattern.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Person", "age", "alice", "bob", "naam"] -rebuilt : ScopeId(0): ["age", "naam"] +after transform: ScopeId(0): ["Person", "_objectSpread", "age", "alice", "bob", "naam"] +rebuilt : ScopeId(0): ["_objectSpread", "age", "naam"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] rebuilt : ScopeId(0): [] @@ -57531,32 +57685,32 @@ Reference symbol mismatch for "alice": after transform: SymbolId(2) "alice" rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["alice", "bob"] +after transform: ["require"] +rebuilt : ["alice", "bob", "require"] tasks/coverage/typescript/tests/cases/conformance/types/spread/spreadExcessProperty.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["A", "a1", "extra1"] -rebuilt : ScopeId(0): ["a1", "extra1"] +after transform: ScopeId(0): ["A", "_objectSpread", "a1", "extra1"] +rebuilt : ScopeId(0): ["_objectSpread", "a1", "extra1"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] rebuilt : ScopeId(0): [] tasks/coverage/typescript/tests/cases/conformance/types/spread/spreadNonPrimitive.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["o", "x"] -rebuilt : ScopeId(0): ["x"] +after transform: ScopeId(0): ["_objectSpread", "o", "x"] +rebuilt : ScopeId(0): ["_objectSpread", "x"] Reference symbol mismatch for "o": after transform: SymbolId(0) "o" rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["o"] +after transform: ["require"] +rebuilt : ["o", "require"] tasks/coverage/typescript/tests/cases/conformance/types/spread/spreadOverwritesProperty.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["ab", "abq", "g", "h", "unused1", "unused2", "unused3"] -rebuilt : ScopeId(0): ["g", "h", "unused1", "unused2", "unused3"] +after transform: ScopeId(0): ["_objectSpread", "ab", "abq", "g", "h", "unused1", "unused2", "unused3"] +rebuilt : ScopeId(0): ["_objectSpread", "g", "h", "unused1", "unused2", "unused3"] Reference symbol mismatch for "ab": after transform: SymbolId(0) "ab" rebuilt : @@ -57570,13 +57724,13 @@ Reference symbol mismatch for "abq": after transform: SymbolId(1) "abq" rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["ab", "abq"] +after transform: ["require"] +rebuilt : ["ab", "abq", "require"] tasks/coverage/typescript/tests/cases/conformance/types/spread/spreadUnion4.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["a", "b", "c"] -rebuilt : ScopeId(0): ["c"] +after transform: ScopeId(0): ["_objectSpread", "a", "b", "c"] +rebuilt : ScopeId(0): ["_objectSpread", "c"] Reference symbol mismatch for "a": after transform: SymbolId(0) "a" rebuilt : @@ -57584,8 +57738,8 @@ Reference symbol mismatch for "b": after transform: SymbolId(1) "b" rebuilt : Unresolved references mismatch: -after transform: [] -rebuilt : ["a", "b"] +after transform: ["require"] +rebuilt : ["a", "b", "require"] tasks/coverage/typescript/tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf01.ts semantic error: Bindings mismatch: @@ -59019,8 +59173,8 @@ rebuilt : [] tasks/coverage/typescript/tests/cases/conformance/types/typeRelationships/assignmentCompatibility/intersectionIncludingPropFromGlobalAugmentation.ts semantic error: Bindings mismatch: -after transform: ScopeId(0): ["Test1", "Test2", "hasOwn", "source", "target", "toString"] -rebuilt : ScopeId(0): ["hasOwn", "target", "toString"] +after transform: ScopeId(0): ["Test1", "Test2", "_objectSpread", "hasOwn", "source", "target", "toString"] +rebuilt : ScopeId(0): ["_objectSpread", "hasOwn", "target", "toString"] Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] rebuilt : ScopeId(0): [] diff --git a/tasks/coverage/snapshots/transformer_typescript.snap b/tasks/coverage/snapshots/transformer_typescript.snap index aa7a998abdb943..cec4ce20137729 100644 --- a/tasks/coverage/snapshots/transformer_typescript.snap +++ b/tasks/coverage/snapshots/transformer_typescript.snap @@ -2,5 +2,6 @@ commit: df9d1650 transformer_typescript Summary: AST Parsed : 6490/6490 (100.00%) -Positive Passed: 6489/6490 (99.98%) +Positive Passed: 6488/6490 (99.97%) +Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentsAfterSpread.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/inline/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.tsx diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/assignment-expression/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/assignment-expression/output.js new file mode 100644 index 00000000000000..f5642866c2bde9 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/assignment-expression/output.js @@ -0,0 +1,6 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +({a1} = c1); +var _c; +_c = c2, {a2} = _c, b2 = _objectWithoutProperties(_c, ["a2"]), _c; +var _c2; +console.log((_c2 = c3, {a3} = _c2, b3 = _objectWithoutProperties(_c2, ["a3"]), _c2)); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/catch-clause/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/catch-clause/output.js new file mode 100644 index 00000000000000..9392f370d44db2 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/catch-clause/output.js @@ -0,0 +1,18 @@ +const _excluded = ["a1"], _excluded2 = ["a2", "b2"], _excluded3 = ["c3"]; +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +try {} catch (_ref) { + let a34 = _extends({}, (_objectDestructuringEmpty(_ref), _ref)); +} +try {} catch (_ref2) { + let { a1 } = _ref2, b1 = _objectWithoutProperties(_ref2, _excluded); +} +try {} catch (_ref3) { + let { a2, b2 } = _ref3, c2 = _objectWithoutProperties(_ref3, _excluded2); +} +try {} catch (_ref4) { + let { a2, b2, c2: _ref5 } = _ref4, { c3 } = _ref5, c4 = _objectWithoutProperties(_ref5, _excluded3); +} +try {} catch (a) {} +try {} catch ({ b }) {} diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/duplicate-decl-bug/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/duplicate-decl-bug/output.js new file mode 100644 index 00000000000000..db3b63c1aeaab9 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/duplicate-decl-bug/output.js @@ -0,0 +1,9 @@ +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +it("es7.objectRestSpread", () => { + let original = { + a: 1, + b: 2 + }; + let copy = _extends({}, (_objectDestructuringEmpty(original), original)); +}); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/export/output.mjs b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/export/output.mjs new file mode 100644 index 00000000000000..8cfb0d86e8e16c --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/export/output.mjs @@ -0,0 +1,4 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +export var { b } = asdf2, c = _objectWithoutProperties(asdf2, ["b"]); +export var { bb, cc } = ads; +export var [dd, ee, ...ff] = ads; diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/output.js new file mode 100644 index 00000000000000..65388f392eb9d5 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/output.js @@ -0,0 +1,27 @@ +const _excluded = ["a"], _excluded2 = ["a"], _excluded3 = ["a"]; +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +for (const [_ref] of []) { + let { a } = _ref, b = _objectWithoutProperties(_ref, _excluded); +} +for (var _ref2 of []) { + var _ref3; + var _ref4; + [_ref3] = _ref2, _ref4 = _ref3, {a} = _ref4, b = _objectWithoutProperties(_ref4, _excluded2), _ref4; +} +async function a() { + for await (var _ref5 of []) { + var _ref6; + var _ref7; + [_ref6] = _ref5, _ref7 = _ref6, {a} = _ref7, b = _objectWithoutProperties(_ref7, _excluded3), _ref7; + } +} +for ([{a}] in {}) {} +for ([{a}] of []) {} +async function a() { + for await ([{a}] of []) {} +} +for ([a,...b] in {}) {} +for ([a,...b] of []) {} +async function a() { + for await ([a,...b] of []) {} +} diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/for-x-completion-record/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/for-x-completion-record/output.js new file mode 100644 index 00000000000000..35868ea38e96b6 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/for-x-completion-record/output.js @@ -0,0 +1,6 @@ +const _excluded = ["a"]; +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +for (var _ref of []) { + var _ref2; + _ref2 = _ref, {a} = _ref2, b = _objectWithoutProperties(_ref2, _excluded), _ref2; +} diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/for-x/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/for-x/output.js new file mode 100644 index 00000000000000..d4e3be938a8a83 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/for-x/output.js @@ -0,0 +1,25 @@ +const _excluded = ["a"], _excluded2 = ["a"], _excluded3 = ["a"]; +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +for (var _ref of []) { + let { a } = _ref, b = _objectWithoutProperties(_ref, _excluded); +} +for (var _ref2 of []) { + var _ref3; + _ref3 = _ref2, {a} = _ref3, b = _objectWithoutProperties(_ref3, _excluded2), _ref3; +} +async function a() { + for await (var _ref4 of []) { + var _ref5; + _ref5 = _ref4, {a} = _ref5, b = _objectWithoutProperties(_ref5, _excluded3), _ref5; + } +} +for ({a} in {}) {} +for ({a} of []) {} +async function a() { + for await ({a} of []) {} +} +for (a in {}) {} +for (a of []) {} +async function a() { + for await (a of []) {} +} diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/impure-computed/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/impure-computed/output.js new file mode 100644 index 00000000000000..fe56879c08c497 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/impure-computed/output.js @@ -0,0 +1,27 @@ +var _toPropertyKey = require("@babel/runtime/helpers/toPropertyKey"); +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +var key, x, y, z; +key = 1; +var _$a = { + 1: 1, + a: 1 +}, _key = key++, { [_key]: y } = _$a, x = _objectWithoutProperties(_$a, [_key].map(_toPropertyKey)); +expect(x).toEqual({ a: 1 }); +expect(key).toBe(2); +expect(y).toBe(1); +key = 1; +var _$ = { + 2: 2, + 3: 3 +}, _key2 = ++key, _key3 = ++key, { [_key2]: y, [_key3]: z } = _$, rest = _objectWithoutProperties(_$, [_key2, _key3].map(_toPropertyKey)); +expect(y).toBe(2); +expect(z).toBe(3); +key = 2; +var _$z; +_$z = { + 2: "two", + z: "zee" +}, {[key]: y, z} = _$z, x = _objectWithoutProperties(_$z, [key, "z"].map(_toPropertyKey)), _$z; +expect(y).toBe("two"); +expect(x).toEqual({}); +expect(z).toBe("zee"); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-2/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-2/output.js new file mode 100644 index 00000000000000..4cbe0b565eed2e --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-2/output.js @@ -0,0 +1,7 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +const test = { foo: { bar: { baz: { a: { + x: 1, + y: 2, + z: 3 +} } } } }; +const { foo: { bar: { baz: { a: _ref } } } } = test, { x } = _ref, other = _objectWithoutProperties(_ref, ["x"]); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-array-2/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-array-2/output.js new file mode 100644 index 00000000000000..a9e0b73b4d9009 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-array-2/output.js @@ -0,0 +1,2 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +const [a, [_ref], _ref2, [_ref3, { h: [i, _ref4] }]] = x, { b } = _ref, c = _objectWithoutProperties(_ref, ["b"]), { d } = _ref2, e = _objectWithoutProperties(_ref2, ["d"]), { f } = _ref3, g = _objectWithoutProperties(_ref3, ["f"]), { j } = _ref4, k = _objectWithoutProperties(_ref4, ["j"]); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-array/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-array/output.js new file mode 100644 index 00000000000000..19ae884a8b4d94 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-array/output.js @@ -0,0 +1,6 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +const [a, _ref] = x, { b } = _ref, c = _objectWithoutProperties(_ref, ["b"]); +let [d, _ref2] = x, { e } = _ref2, f = _objectWithoutProperties(_ref2, ["e"]); +var _ref3; +var _ref4; +[g, _ref3] = x, _ref4 = _ref3, {h} = _ref4, i = _objectWithoutProperties(_ref4, ["h"]), _ref4; diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-computed-key/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-computed-key/output.js new file mode 100644 index 00000000000000..da9d9429effbba --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-computed-key/output.js @@ -0,0 +1,6 @@ +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +const { [(_ref) => { + let rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref)); + let _ref2 = {}, b = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2)); +}]: a, [(_ref3 = {}, {} = _ref3, d = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3)), _ref3)]: c } = {}; diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-default-value/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-default-value/output.js new file mode 100644 index 00000000000000..c97cb82b8e94d3 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-default-value/output.js @@ -0,0 +1,6 @@ +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +const { a = (_ref) => { + let rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref)); + let _ref2 = {}, b = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2)); +}, c = (_ref3 = {}, {} = _ref3, d = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3)), _ref3) } = {}; diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-literal-property/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-literal-property/output.js new file mode 100644 index 00000000000000..5d386ee09ab4cc --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-literal-property/output.js @@ -0,0 +1,3 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +let useState = [{ some: 42 }, () => null]; +let { 0: _ref, "2": _ref2, 1: setState } = useState, { numeric } = _ref, rest1 = _objectWithoutProperties(_ref, ["numeric"]), { str } = _ref2, rest2 = _objectWithoutProperties(_ref2, ["str"]); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-order/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-order/output.js new file mode 100644 index 00000000000000..dd8c9ff87ed763 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-order/output.js @@ -0,0 +1,4 @@ +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +const { a: _ref, b: _ref2 } = obj, bar = _extends({}, (_objectDestructuringEmpty(_ref), _ref)), baz = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2)), foo = _objectWithoutProperties(obj, ["a", "b"]); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested/output.js new file mode 100644 index 00000000000000..9cc00d95472f59 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested/output.js @@ -0,0 +1,6 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +const defunct = { outer: { inner: { + three: "three", + four: "four" +} } }; +const { outer: { inner: _ref } } = defunct, { three } = _ref, other = _objectWithoutProperties(_ref, ["three"]); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/non-string-computed/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/non-string-computed/output.js new file mode 100644 index 00000000000000..51058298e0d1d1 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/non-string-computed/output.js @@ -0,0 +1,47 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +var _toPropertyKey = require("@babel/runtime/helpers/toPropertyKey"); +const a = { + "3": "three", + "foo": "bar" +}; +const { [3]: omit } = a, rest = _objectWithoutProperties(a, ["3"]); +expect(rest).toEqual({ "foo": "bar" }); +expect(omit).toBe("three"); +const [k1, k2, k3, k4, k5] = [ + null, + undefined, + true, + false, + { toString() { + return "warrior"; + } } +]; +const c = { + [k1]: "1", + [k2]: "2", + [k3]: "3", + [k4]: "4", + [k5]: "5" +}; +const { [k1]: v1, [k2]: v2, [k3]: v3, [k4]: v4, [k5]: v5 } = c, vrest = _objectWithoutProperties(c, [ + k1, + k2, + k3, + k4, + k5 +].map(_toPropertyKey)); +expect(v1).toBe("1"); +expect(v2).toBe("2"); +expect(v3).toBe("3"); +expect(v4).toBe("4"); +expect(v5).toBe("5"); +expect(vrest).toEqual({}); +const sx = Symbol(); +const sy = Symbol(); +const d = { + [sx]: "sx", + [sy]: "sy" +}; +const { [sx]: dx, [sy]: dy } = d; +expect(dx).toBe("sx"); +expect(dy).toBe("sy"); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/null-destructuring/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/null-destructuring/output.js new file mode 100644 index 00000000000000..f4e8257795ae78 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/null-destructuring/output.js @@ -0,0 +1,10 @@ +const _excluded = ["x"]; +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +expect(() => { + var _ref = null, x = _extends({}, (_objectDestructuringEmpty(_ref), _ref)); +}).toThrow(/null/); +expect(() => { + var _ref2 = null, { x } = _ref2, y = _objectWithoutProperties(_ref2, _excluded); +}).toThrow(/null/); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/object-ref-computed/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/object-ref-computed/output.js new file mode 100644 index 00000000000000..63d3e68376f150 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/object-ref-computed/output.js @@ -0,0 +1,26 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +var key, x, y, z; +key = 1; +var _ = { 1: { + a: 1, + y: 1 +} }, { [key++]: _ref } = _, { y } = _ref, x = _objectWithoutProperties(_ref, ["y"]); +expect(x).toEqual({ a: 1 }); +expect(key).toBe(2); +expect(y).toBe(1); +key = 1; +var _$ = { + 2: { + y: 2, + z: 3 + }, + 3: { + y: 2, + z: 3 + } +}, { [++key]: _ref2, [++key]: _ref3 } = _$, { y } = _ref2, rest_y = _objectWithoutProperties(_ref2, ["y"]), { z } = _ref3, rest_z = _objectWithoutProperties(_ref3, ["z"]); +expect(y).toBe(2); +expect(rest_y).toEqual({ z: 3 }); +expect(z).toBe(3); +expect(rest_z).toEqual({ y: 2 }); +expect(key).toBe(3); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/parameters-object-rest-used-in-default/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/parameters-object-rest-used-in-default/output.js new file mode 100644 index 00000000000000..7c8ff6d10141db --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/parameters-object-rest-used-in-default/output.js @@ -0,0 +1,29 @@ +const _excluded = ["X"]; +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +(_ref, a = R) => { + let R = _extends({}, (_objectDestructuringEmpty(_ref), _ref)); +}; +(_ref2, { a = { Y } }) => { + let { X: Y } = _ref2, R = _objectWithoutProperties(_ref2, _excluded); +}; +(a = R, _ref3) => { + let R = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3)); +}; +(_ref4, e, c = 2, a = R, f = q) => { + let R = _extends({}, (_objectDestructuringEmpty(_ref4), _ref4)); + let q; +}; +(_ref5, a = f(R)) => { + let R = _extends({}, (_objectDestructuringEmpty(_ref5), _ref5)); +}; +(_ref6, { [R.key]: a = 42 }) => { + let R = _extends({}, (_objectDestructuringEmpty(_ref6), _ref6)); +}; +(_ref7, { a = { R: b } }) => { + let R = _extends({}, (_objectDestructuringEmpty(_ref7), _ref7)); +}; +(_ref8, { a = (R) => R } = { b: (R) => R }) => { + let R = _extends({}, (_objectDestructuringEmpty(_ref8), _ref8)); +}; diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/parameters/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/parameters/output.js new file mode 100644 index 00000000000000..b0ccf01493c330 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/parameters/output.js @@ -0,0 +1,38 @@ +const _excluded = ["a1"], _excluded2 = ["a2", "b2"], _excluded3 = ["a5"], _excluded4 = ["a3"], _excluded5 = ["ba1"], _excluded6 = ["a3", "b2"], _excluded7 = ["ba1"], _excluded8 = ["a1"], _excluded9 = ["a1"]; +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +function a(_ref) { + let a34 = _extends({}, (_objectDestructuringEmpty(_ref), _ref)); +} +function a2(_ref2) { + let { a1 } = _ref2, b1 = _objectWithoutProperties(_ref2, _excluded); +} +function a3(_ref3) { + let { a2, b2 } = _ref3, c2 = _objectWithoutProperties(_ref3, _excluded2); +} +function a4(_ref4, _ref5) { + let { a5 } = _ref5, c5 = _objectWithoutProperties(_ref5, _excluded3); + let { a3 } = _ref4, c3 = _objectWithoutProperties(_ref4, _excluded4); +} +function a5(_ref6) { + let { a3, b2: _ref7 } = _ref6, { ba1 } = _ref7, ba2 = _objectWithoutProperties(_ref7, _excluded5), c3 = _objectWithoutProperties(_ref6, _excluded6); +} +function a6(_ref8) { + let { a3, b2: _ref9 } = _ref8, { ba1 } = _ref9, ba2 = _objectWithoutProperties(_ref9, _excluded7); +} +function a7(_ref10 = {}) { + let { a1 = 1 } = _ref10, b1 = _objectWithoutProperties(_ref10, _excluded8); +} +function a8([_ref11]) { + let a1 = _extends({}, (_objectDestructuringEmpty(_ref11), _ref11)); +} +function a9([_ref12]) { + let { a1 } = _ref12, a2 = _objectWithoutProperties(_ref12, _excluded9); +} +function a10([a1, _ref13]) { + let a2 = _extends({}, (_objectDestructuringEmpty(_ref13), _ref13)); +} +function b(a) {} +function b2(a, ...b) {} +function b3({ b }) {} diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/symbol/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/symbol/output.js new file mode 100644 index 00000000000000..bc440ec97077b8 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/symbol/output.js @@ -0,0 +1,6 @@ +var _toPropertyKey = require("@babel/runtime/helpers/toPropertyKey"); +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +let _ref = {}, _Symbol$for = Symbol.for("foo"), { [_Symbol$for]: foo } = _ref, rest = _objectWithoutProperties(_ref, [_Symbol$for].map(_toPropertyKey)); +var _ref2, _Symbol$for2 = Symbol.for("foo"); +_ref2 = {}, {[_Symbol$for2]: foo} = _ref2, rest = _objectWithoutProperties(_ref2, [_Symbol$for2].map(_toPropertyKey)), _ref2; +if (_ref3 = {}, {[_Symbol$for3]: foo} = _ref3, rest = _objectWithoutProperties(_ref3, [_Symbol$for3].map(_toPropertyKey)), _ref3) {} diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/template-literal-allLiterals-true-no-hoisting/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/template-literal-allLiterals-true-no-hoisting/output.js new file mode 100644 index 00000000000000..dc7f938817f7ea --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/template-literal-allLiterals-true-no-hoisting/output.js @@ -0,0 +1,8 @@ +var _toPropertyKey = require("@babel/runtime/helpers/toPropertyKey"); +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +const example = () => { + const input = {}; + const foo = "foo"; + var _input, _ref = `${foo}_bar`; + _input = input, {[_ref]: country} = _input, rest = _objectWithoutProperties(_input, [_ref].map(_toPropertyKey)), _input; +}; diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/template-literal-property-allLiterals-false/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/template-literal-property-allLiterals-false/output.js new file mode 100644 index 00000000000000..4bda99dc05b885 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/template-literal-property-allLiterals-false/output.js @@ -0,0 +1,10 @@ +var _toPropertyKey = require("@babel/runtime/helpers/toPropertyKey"); +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +const input = {}; +const _ref = prefix + "state", _ref2 = `${prefix}consents`, { given_name: givenName, "last_name": lastName, [`country`]: country, [_ref]: state, [_ref2]: consents } = input, rest = _objectWithoutProperties(input, [ + "given_name", + "last_name", + `country`, + _ref, + _ref2 +].map(_toPropertyKey)); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/template-literal-property-allLiterals-true/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/template-literal-property-allLiterals-true/output.js new file mode 100644 index 00000000000000..a9dfac9798f1c3 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/template-literal-property-allLiterals-true/output.js @@ -0,0 +1,7 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +const input = {}; +const { given_name: givenName, "last_name": lastName, [`country`]: country } = input, rest = _objectWithoutProperties(input, [ + "given_name", + "last_name", + `country` +]); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/variable-destructuring/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/variable-destructuring/output.js new file mode 100644 index 00000000000000..08a8bba8c5b312 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/variable-destructuring/output.js @@ -0,0 +1,36 @@ +var _toPropertyKey = require("@babel/runtime/helpers/toPropertyKey"); +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +const _z = z(), { x15: [ ...{ ...y15 }] } = _z; +let { x: _ref, y: _ref2 } = complex, { a: xa, [d]: f } = _ref, asdf = _objectWithoutProperties(_ref, ["a", d].map(_toPropertyKey)), d = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2)), g = _objectWithoutProperties(complex, ["x", "y"]); +let _z2 = z(), { x4: _ref3 } = _z2, y4 = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3)); +let _z3 = z(), { x5: _ref4 } = _z3, { w5 } = _ref4, y5 = _objectWithoutProperties(_ref4, ["w5"]); +let _z4 = z(), { x6: { w6: _ref5 } } = _z4, { a6 } = _ref5, y6 = _objectWithoutProperties(_ref5, ["a6"]); +let _z5 = z(), { x7: { e7, r7 }, q7: { w7: _ref6 } } = _z5, { a7 } = _ref6, y7 = _objectWithoutProperties(_ref6, ["a7"]); +let _z6 = z(), { x8 } = _z6, y8 = _objectWithoutProperties(_z6, ["x8"]); +let _z7 = z(), { x9: { w9: _ref7 }, x10: _ref8 } = _z7, { a9 } = _ref7, y9 = _objectWithoutProperties(_ref7, ["a9"]), { a10 } = _ref8, y10 = _objectWithoutProperties(_ref8, ["a10"]); +let _z8 = z(), { x11: [_ref9] } = _z8, { w11 } = _ref9, z11 = _objectWithoutProperties(_ref9, ["w11"]); +let _z9 = z(), { x12: [{ a12, b12 }, _ref10] } = _z9, { c12 } = _ref10, d12 = _objectWithoutProperties(_ref10, ["c12"]); +let _z10 = z(), { x13: [, _ref11] } = _z10, { c13 } = _ref11, d13 = _objectWithoutProperties(_ref11, ["c13"]); +const _z11 = z(), { x14: [ ...{ q14,...y14 }] } = _z11; +const _z12 = z(), { x15: [ ...{ ...y16 }] } = _z12; +const { x16: [] } = z(); +const [ ...[ ...y17]] = z(); +const _z13 = z(), [ ...{ ...y18 }] = _z13; +const _z14 = z(), [ ...{ a19,...y19 }] = _z14; +const _z15 = z(), { x20: _ref12 = {} } = _z15, y20 = _extends({}, (_objectDestructuringEmpty(_ref12), _ref12)); +const _z16 = z(), { x22: _ref13 = {} } = _z16, { q22 } = _ref13, y22 = _objectWithoutProperties(_ref13, ["q22"]); +const [[ ...y23] = []] = z(); +const _z17 = z(), [_ref14 = []] = _z17, y24 = _extends({}, (_objectDestructuringEmpty(_ref14), _ref14)); +const { x25: [ ...y25] = [] } = z(); +const { x26: [q26, ...y26] = [] } = z(); +const {} = {}; +const [, , x27] = z(); +const _z18 = z(), { x28: [, , _ref15] } = _z18, y28 = _extends({}, (_objectDestructuringEmpty(_ref15), _ref15)); +const _z19 = z(), { x29: [, , _ref16] } = _z19, { q29 } = _ref16, y29 = _objectWithoutProperties(_ref16, ["q29"]); +const _z20 = z(), [, , _ref17] = _z20, { y30 } = _ref17, x30 = _objectWithoutProperties(_ref17, ["y30"]); +const _z21 = z(), [, , _ref18] = _z21, x31 = _extends({}, (_objectDestructuringEmpty(_ref18), _ref18)); +const _z22 = z(), { x32: {}, w32: _ref19 } = _z22, y32 = _extends({}, (_objectDestructuringEmpty(_ref19), _ref19)); +const _z23 = z(), [, , {}, _ref20] = _z23, q32 = _extends({}, (_objectDestructuringEmpty(_ref20), _ref20)); +const _z24 = z(), y33 = _extends({}, (_objectDestructuringEmpty(_z24), _z24)); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/with-array-rest/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/with-array-rest/output.js new file mode 100644 index 00000000000000..cd0a3f8103d882 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/with-array-rest/output.js @@ -0,0 +1,10 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +let _a$d = { + a: [ + 1, + 2, + 3, + 4 + ], + d: "oyez" +}, { a: [b, ...arrayRest], c = function(...functionRest) {} } = _a$d, objectRest = _objectWithoutProperties(_a$d, ["a", "c"]); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/assignment/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/assignment/output.js new file mode 100644 index 00000000000000..9e3d280920eec7 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/assignment/output.js @@ -0,0 +1,9 @@ +var _objectSpread = require("@babel/runtime/helpers/objectSpread2"); +var x; +var y; +var z; +z = _objectSpread({ x }, y); +z = { + x, + w: _objectSpread({}, y) +}; diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/expression/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/expression/output.js new file mode 100644 index 00000000000000..86f069440b2717 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/expression/output.js @@ -0,0 +1,14 @@ +var _objectSpread = require("@babel/runtime/helpers/objectSpread2"); +var a; +var b; +var c; +var d; +var x; +var y; +_objectSpread(_objectSpread(_objectSpread({ x }, y), {}, { a }, b), {}, { c }); +_objectSpread({}, Object.prototype); +_objectSpread({}, { foo: "bar" }); +_objectSpread(_objectSpread({}, { foo: "bar" }), { bar: "baz" }); +_objectSpread({}, { get foo() { + return "foo"; +} }); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/side-effect/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/side-effect/output.js new file mode 100644 index 00000000000000..877309de305bcb --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/side-effect/output.js @@ -0,0 +1,19 @@ +var _objectSpread = require("@babel/runtime/helpers/objectSpread2"); +var k = { + a: 1, + b: 2 +}; +var o = _objectSpread(_objectSpread({ a: 3 }, k), {}, { b: k.a++ }); +var pureA = {}; +var pureB = {}; +var pureC = {}; +var pureD = {}; +var pureE = {}; +function impureFunc() { + console.log("hello"); +} +var output = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, pureA), {}, { + get foo() {}, + get bar() {} +}, pureB), pureC), impureFunc()), pureD), {}, { pureD }); +var simpleOutput = _objectSpread(_objectSpread({}, pureA), {}, { test: "1" }, pureB); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/variable-declaration/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/variable-declaration/output.js new file mode 100644 index 00000000000000..b9b2ab62b9b89a --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/object-spread/variable-declaration/output.js @@ -0,0 +1,2 @@ +var _objectSpread = require("@babel/runtime/helpers/objectSpread2"); +var z = _objectSpread({}, x); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-4904/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-4904/output.js new file mode 100644 index 00000000000000..53639e1439cc52 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-4904/output.js @@ -0,0 +1,8 @@ +const _excluded = ["b"]; +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +const _foo = foo(), { s } = _foo, t = _objectWithoutProperties(_foo, ["s"]); +const _bar = bar(), { s: _ref } = _bar, { q1 } = _ref, q2 = _objectWithoutProperties(_ref, ["q1"]), q3 = _objectWithoutProperties(_bar, ["s"]); +const { a } = foo((_ref2) => { + let { b } = _ref2, c = _objectWithoutProperties(_ref2, _excluded); + console.log(b, c); +}); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-5151/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-5151/output.js new file mode 100644 index 00000000000000..2bff77c20bd9dd --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-5151/output.js @@ -0,0 +1,6 @@ +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +const { x } = a, y = _objectWithoutProperties(a, ["x"]), z = foo(y); +const s = _extends({}, (_objectDestructuringEmpty(r), r)), t = foo(s); +var l = foo(), _bar = bar(), { m: _ref } = _bar, { n } = _ref, o = _objectWithoutProperties(_ref, ["n"]), p = _objectWithoutProperties(_bar, ["m"]), q = baz(); diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-7304/output.mjs b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-7304/output.mjs new file mode 100644 index 00000000000000..01ea9e9a27ee78 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-7304/output.mjs @@ -0,0 +1,7 @@ +var _objectDestructuringEmpty = require("@babel/runtime/helpers/objectDestructuringEmpty"); +var _extends = require("@babel/runtime/helpers/extends"); +export default class { + method(_ref) { + let object = _extends({}, (_objectDestructuringEmpty(_ref), _ref)); + } +} diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-7388/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-7388/output.js new file mode 100644 index 00000000000000..e8e1bd9f0ce703 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-7388/output.js @@ -0,0 +1,10 @@ +const _excluded = ["a"]; +var _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"); +function fn0(obj0) { + const { fn1 = (obj1 = {}) => { + const { fn2 = (obj2 = {}) => { + const { a } = obj2, rest = _objectWithoutProperties(obj2, _excluded); + console.log(rest); + } } = obj1; + } } = obj0; +} diff --git a/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-8323/output.js b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-8323/output.js new file mode 100644 index 00000000000000..500d1bfe5ac8b9 --- /dev/null +++ b/tasks/transform_conformance/snapshots/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-8323/output.js @@ -0,0 +1,2 @@ + + x Option `loose` is not implemented for object-rest-spread. diff --git a/tasks/transform_conformance/snapshots/babel.snap.md b/tasks/transform_conformance/snapshots/babel.snap.md index dd3442d5cced98..94e0e99285eeba 100644 --- a/tasks/transform_conformance/snapshots/babel.snap.md +++ b/tasks/transform_conformance/snapshots/babel.snap.md @@ -1,6 +1,6 @@ commit: d20b314c -Passed: 328/575 +Passed: 327/575 # All Passed: * babel-plugin-transform-class-static-block @@ -296,9 +296,18 @@ x Output mismatch x Output mismatch -# babel-plugin-transform-async-to-generator (11/28) +# babel-plugin-transform-async-to-generator (10/28) * assumption-ignoreFunctionLength-true/basic/input.mjs -x Output mismatch + + x Compiler assumption `ignoreFunctionLength` is not implemented for object- + | rest-spread. + + +* assumption-ignoreFunctionLength-true/export-default-function/input.mjs + + x Compiler assumption `ignoreFunctionLength` is not implemented for object- + | rest-spread. + * assumption-noNewArrows-false/basic/input.js x Output mismatch @@ -2071,10 +2080,17 @@ transform-react-jsx: unknown field `autoImport`, expected one of `runtime`, `dev * spread-transform/transform-to-babel-extend/input.js -x Output mismatch + + x Option `loose` is not implemented for object-rest-spread. + * spread-transform/transform-to-object-assign/input.js -x Output mismatch + + x Option `loose` is not implemented for object-rest-spread. + + + x Option `useBuiltIns` is not implemented for object-rest-spread. + # babel-plugin-transform-react-jsx-development (8/11) diff --git a/tasks/transform_conformance/snapshots/oxc.snap.md b/tasks/transform_conformance/snapshots/oxc.snap.md index 1cc7879ddaed13..2294e8050b7dfb 100644 --- a/tasks/transform_conformance/snapshots/oxc.snap.md +++ b/tasks/transform_conformance/snapshots/oxc.snap.md @@ -1,6 +1,6 @@ commit: d20b314c -Passed: 85/95 +Passed: 88/100 # All Passed: * babel-plugin-transform-class-static-block @@ -15,6 +15,18 @@ Passed: 85/95 * regexp +# babel-plugin-transform-object-rest-spread (3/5) +* object-rest/assignment-expression/input.js +Reference flags mismatch for "a2": +after transform: ReferenceId(2): ReferenceFlags(Write) +rebuilt : ReferenceId(4): ReferenceFlags(Read | Write) + +* object-rest/export/input.js +Symbol flags mismatch for "b0": +after transform: SymbolId(1): SymbolFlags(BlockScopedVariable | Export) +rebuilt : SymbolId(2): SymbolFlags(BlockScopedVariable) + + # babel-plugin-transform-typescript (2/9) * class-property-definition/input.ts Unresolved references mismatch: diff --git a/tasks/transform_conformance/src/constants.rs b/tasks/transform_conformance/src/constants.rs index 15fa592141f831..a25f3183a49414 100644 --- a/tasks/transform_conformance/src/constants.rs +++ b/tasks/transform_conformance/src/constants.rs @@ -24,7 +24,7 @@ pub const PLUGINS: &[&str] = &[ // "babel-plugin-transform-json-strings", // // ES2018 "babel-plugin-transform-async-generator-functions", - // "babel-plugin-transform-object-rest-spread", + "babel-plugin-transform-object-rest-spread", // // [Regex] "babel-plugin-transform-unicode-property-regex", // "babel-plugin-transform-dotall-regex", // // [Regex] "babel-plugin-transform-named-capturing-groups-regex", @@ -100,6 +100,11 @@ pub const SKIP_TESTS: &[&str] = &[ "babel-preset-env/test/fixtures/corejs3", "babel-preset-env/test/fixtures/debug", "babel-preset-env/test/fixtures/debug-babel-7", + // Assumptions are not implemented yet. + "babel-plugin-transform-object-rest-spread/test/fixtures/assumption", + "babel-plugin-transform-object-rest-spread/test/fixtures/object-spread-loose", + "babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/remove-unused-excluded-keys-loose", + "babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/regression/gh-8323" ]; pub const SNAPSHOT_TESTS: &[&str] = diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/assignment-expression/input.js b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/assignment-expression/input.js new file mode 100644 index 00000000000000..c4de05d8abb5d8 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/assignment-expression/input.js @@ -0,0 +1,8 @@ +({ a1 } = c1); +({ a2, ...b2 } = c2); +(a0, { a2, ...b2 } = c2); +(a0, { a2, ...b2 } = c2, a1); + +console.log({ a3, ...b3 } = c3); +console.log((a0, { a3, ...b3 } = c3)); +console.log((a0, { a3, ...b3 } = c3, a3)); diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/assignment-expression/output.js b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/assignment-expression/output.js new file mode 100644 index 00000000000000..067f7c7c93973a --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/assignment-expression/output.js @@ -0,0 +1,13 @@ +({a1} = c1); +var _c; +_c = c2, {a2} = _c, b2 = babelHelpers.objectWithoutProperties(_c, ["a2"]), _c; +var _c2; +a0, _c2 = c2, {a2} = _c2, b2 = babelHelpers.objectWithoutProperties(_c2, ["a2"]), _c2; +var _c3; +a0, _c3 = c2, {a2} = _c3, b2 = babelHelpers.objectWithoutProperties(_c3, ["a2"]), _c3, a1; +var _c4; +console.log((_c4 = c3, {a3} = _c4, b3 = babelHelpers.objectWithoutProperties(_c4, ["a3"]), _c4)); +var _c5; +console.log((a0, _c5 = c3, {a3} = _c5, b3 = babelHelpers.objectWithoutProperties(_c5, ["a3"]), _c5)); +var _c6; +console.log((a0, _c6 = c3, {a3} = _c6, b3 = babelHelpers.objectWithoutProperties(_c6, ["a3"]), _c6, a3)); diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/complex/input.js b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/complex/input.js new file mode 100644 index 00000000000000..ec37c9546ed174 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/complex/input.js @@ -0,0 +1,13 @@ +let [{...a0}] = z + +let [{...b0}, {...b1}] = z + +let { c0: { ...c1 } } = foo; + +let { d0: { d1, ...d2 } } = foo; + +let { e0: { e1: { e2, ...e3 }, ...e4 } } = foo; + +let { f0: { f1: { f2, ...f3 }, ...f4 }, ...f5 } = foo; + +let [{ g0: { g1: { g2, ...g3 }, ...g4 } }, { g5: [{ g6: [{ g7, ...g8 }], ...g9 }] }] = goo; diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/complex/output.js b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/complex/output.js new file mode 100644 index 00000000000000..e4fc44f134f460 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/complex/output.js @@ -0,0 +1,7 @@ +let [_ref] = z, a0 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref), _ref)); +let [_ref2, _ref3] = z, b0 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref2), _ref2)), b1 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref3), _ref3)); +let { c0: _ref4 } = foo, c1 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref4), _ref4)); +let { d0: _ref5 } = foo, { d1 } = _ref5, d2 = babelHelpers.objectWithoutProperties(_ref5, ["d1"]); +let { e0: _ref7 } = foo, { e1: _ref6 } = _ref7, e4 = babelHelpers.objectWithoutProperties(_ref7, ["e1"]), { e2 } = _ref6, e3 = babelHelpers.objectWithoutProperties(_ref6, ["e2"]); +let { f0: _ref9 } = foo, { f1: _ref8 } = _ref9, f4 = babelHelpers.objectWithoutProperties(_ref9, ["f1"]), { f2 } = _ref8, f3 = babelHelpers.objectWithoutProperties(_ref8, ["f2"]), f5 = babelHelpers.objectWithoutProperties(foo, ["f0"]); +let [{ g0: _ref11 }, { g5: [_ref13] }] = goo, { g1: _ref10 } = _ref11, g4 = babelHelpers.objectWithoutProperties(_ref11, ["g1"]), { g2 } = _ref10, g3 = babelHelpers.objectWithoutProperties(_ref10, ["g2"]), { g6: [_ref12] } = _ref13, g9 = babelHelpers.objectWithoutProperties(_ref13, ["g6"]), { g7 } = _ref12, g8 = babelHelpers.objectWithoutProperties(_ref12, ["g7"]); diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/export/input.js b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/export/input.js new file mode 100644 index 00000000000000..bafc57408be1e2 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/export/input.js @@ -0,0 +1,2 @@ +export let { ...a0 } = foo; +export let [{...b0}] = z diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/export/output.js b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/export/output.js new file mode 100644 index 00000000000000..5c493b01e1dd63 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/export/output.js @@ -0,0 +1,2 @@ +export let a0 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(foo), foo)); +export let [_ref] = z, b0 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref), _ref)); diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/keys/input.js b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/keys/input.js new file mode 100644 index 00000000000000..28c4a9935ebe70 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/keys/input.js @@ -0,0 +1 @@ +let { [b0++]: {b1, ...b2}, [b0++]: {b3, ...b4} } = foo(); diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/keys/output.js b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/keys/output.js new file mode 100644 index 00000000000000..b9c54a5e7cd494 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/keys/output.js @@ -0,0 +1 @@ +let _foo = foo(), { [b0++]: _ref, [b0++]: _ref2 } = _foo, { b1 } = _ref, b2 = babelHelpers.objectWithoutProperties(_ref, ["b1"]), { b3 } = _ref2, b4 = babelHelpers.objectWithoutProperties(_ref2, ["b3"]); diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/options.json b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/options.json new file mode 100644 index 00000000000000..85af630bdd1bca --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["transform-object-rest-spread"] +} diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/simple/input.js b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/simple/input.js new file mode 100644 index 00000000000000..4373e1ef0d34ac --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/simple/input.js @@ -0,0 +1,22 @@ +let { ...a0 } = foo; +let { ...b0 } = foo(); + +let { c0, c1, ...c2 } = foo; +let { d0, d1, ...d2 } = foo(); + +let bar, { e0, ...e1 } = foo(), baz; + +for (let bar, { f0, ...f1 } = foo(), baz;;){} +for (let { g0, ...g1 } in foo){} +for (let { h0, ...h1 } of foo){} + +for (let bar, { i0, ...i1 } = ioo(), baz;;); +for (let { j0, ...j1 } in foo); +for (let { k0, ...k1 } of foo); + +for (let bar, { l0, ...l1 } = loo(), baz;;) void 0; +for (let { m0, ...m1 } in foo) void 0; +for (let { n0, ...n1 } of foo) void 0; + +let { [key]: x, ...rest } = foo; +let { [key1]: x2, ...rest2 } = foo(); diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/simple/output.js b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/simple/output.js new file mode 100644 index 00000000000000..43bb2034a412ab --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/simple/output.js @@ -0,0 +1,31 @@ +const _excluded = ["f0"], _excluded2 = ["g0"], _excluded3 = ["h0"], _excluded4 = ["i0"], _excluded5 = ["j0"], _excluded6 = ["k0"], _excluded7 = ["l0"], _excluded8 = ["m0"], _excluded9 = ["n0"]; +let a0 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(foo), foo)); +let _foo = foo(), b0 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_foo), _foo)); +let { c0, c1 } = foo, c2 = babelHelpers.objectWithoutProperties(foo, ["c0", "c1"]); +let _foo2 = foo(), { d0, d1 } = _foo2, d2 = babelHelpers.objectWithoutProperties(_foo2, ["d0", "d1"]); +let bar, _foo3 = foo(), { e0 } = _foo3, e1 = babelHelpers.objectWithoutProperties(_foo3, ["e0"]), baz; +for (let bar, _foo4 = foo(), { f0 } = _foo4, f1 = babelHelpers.objectWithoutProperties(_foo4, _excluded), baz;;) {} +for (let _ref in foo) { + let { g0 } = _ref, g1 = babelHelpers.objectWithoutProperties(_ref, _excluded2); +} +for (let _ref2 of foo) { + let { h0 } = _ref2, h1 = babelHelpers.objectWithoutProperties(_ref2, _excluded3); +} +for (let bar, _ioo = ioo(), { i0 } = _ioo, i1 = babelHelpers.objectWithoutProperties(_ioo, _excluded4), baz;;); +for (let _ref3 in foo) { + let { j0 } = _ref3, j1 = babelHelpers.objectWithoutProperties(_ref3, _excluded5); +} +for (let _ref4 of foo) { + let { k0 } = _ref4, k1 = babelHelpers.objectWithoutProperties(_ref4, _excluded6); +} +for (let bar, _loo = loo(), { l0 } = _loo, l1 = babelHelpers.objectWithoutProperties(_loo, _excluded7), baz;;) void 0; +for (let _ref5 in foo) { + let { m0 } = _ref5, m1 = babelHelpers.objectWithoutProperties(_ref5, _excluded8); + void 0; +} +for (let _ref6 of foo) { + let { n0 } = _ref6, n1 = babelHelpers.objectWithoutProperties(_ref6, _excluded9); + void 0; +} +let _key = key, { [_key]: x } = foo, rest = babelHelpers.objectWithoutProperties(foo, [_key].map(babelHelpers.toPropertyKey)); +let _foo5 = foo(), _key2 = key1, { [_key2]: x2 } = _foo5, rest2 = babelHelpers.objectWithoutProperties(_foo5, [_key2].map(babelHelpers.toPropertyKey));