From 7feaabfe68c94ad8d9817c06b8a792cf3fc47859 Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Thu, 10 Aug 2023 10:59:49 -0400 Subject: [PATCH] [rust] Use hermes parser for Forget fixture tests Replaces the use of SWC parser in the Forget fixture tests with Hermes Parser. This includes aligning on a single type to represent JS Values and numbers (combining semi-duplicated code from forget_hir and forget_estree) and adding support for lowering babel-style NumericLiteral/BooleanLiteral/StringLiteral/NullLiteral node types (since Hermes Parser produces a mix of estree/babel node types) --- compiler/forget/Cargo.lock | 2 +- .../crates/forget_build_hir/src/build.rs | 37 ++- .../crates/forget_estree/src/js_value.rs | 244 +++++++++++++++--- ...e__tests__fixtures@for-statement.json.snap | 12 +- ...t_estree__tests__fixtures@import.json.snap | 4 +- ...get_estree__tests__fixtures@test.json.snap | 4 +- .../crates/forget_estree_swc/src/lib.rs | 2 +- .../forget/crates/forget_fixtures/Cargo.toml | 2 +- .../forget_fixtures/tests/fixtures_test.rs | 2 +- ...ting-primitive-as-dep-nested-scope.js.snap | 2 +- ...xtures@allocating-primitive-as-dep.js.snap | 2 +- ...__fixtures@array-access-assignment.js.snap | 10 +- ...ures@array-at-mutate-after-capture.js.snap | 2 +- ...__fixtures@array-expression-spread.js.snap | 2 +- ...test__fixtures@array-property-call.js.snap | 2 +- ...res@assignment-expression-computed.js.snap | 6 +- ...@assignment-expression-nested-path.js.snap | 4 +- ...nt-variations-complex-lvalue-array.js.snap | 8 +- ...signment-variations-complex-lvalue.js.snap | 6 +- ...st__fixtures@assignment-variations.js.snap | 8 +- ...xtures@babel-existing-react-import.js.snap | 4 +- ...-existing-react-kitchensink-import.js.snap | 4 +- ...ures@capture-indirect-mutate-alias.js.snap | 2 +- ...est__fixtures@capture-param-mutate.js.snap | 14 +- ...fixtures@capture_mutate-across-fns.js.snap | 2 +- ...__fixtures@capturing-func-mutate-2.js.snap | 2 +- ...__fixtures@capturing-func-mutate-3.js.snap | 2 +- ...tures@capturing-func-mutate-nested.js.snap | 2 +- ...st__fixtures@capturing-func-mutate.js.snap | 2 +- ...ing-function-alias-computed-load-2.js.snap | 4 +- ...ing-function-alias-computed-load-3.js.snap | 8 +- ...ing-function-alias-computed-load-4.js.snap | 4 +- ...uring-function-alias-computed-load.js.snap | 2 +- ...s@capturing-reference-changes-type.js.snap | 2 +- ...res@chained-assignment-expressions.js.snap | 10 +- .../parser_test__fixtures@component.js.snap | 6 +- ...res@computed-call-evaluation-order.js.snap | 2 +- ...puted-load-primitive-as-dependency.js.snap | 2 +- ..._test__fixtures@concise-arrow-expr.js.snap | 2 +- ...es@conditional-set-state-in-render.js.snap | 6 +- ...into-function-expression-primitive.js.snap | 2 +- ..._fixtures@constant-propagation-for.js.snap | 8 +- ...pagation-into-function-expressions.js.snap | 2 +- ..._fixtures@constant-propagation-phi.js.snap | 10 +- ...ixtures@constant-propagation-while.js.snap | 8 +- ...est__fixtures@constant-propagation.js.snap | 6 +- ...er_test__fixtures@controlled-input.js.snap | 2 +- .../parser_test__fixtures@dce-loop.js.snap | 4 +- ...n-variable-in-function-declaration.js.snap | 2 +- ...@destructuring-array-param-default.js.snap | 2 +- ...destructuring-object-param-default.js.snap | 2 +- ...t__fixtures@do-while-compound-test.js.snap | 8 +- ...ixtures@do-while-conditional-break.js.snap | 10 +- ...r_test__fixtures@do-while-continue.js.snap | 12 +- ...do-while-early-unconditional-break.js.snap | 6 +- ...ser_test__fixtures@do-while-simple.js.snap | 8 +- .../parser_test__fixtures@dominator.js.snap | 14 +- ...parser_test__fixtures@early-return.js.snap | 2 +- ...el-existing-react-namespace-import.js.snap | 4 +- ...l-mutable-range-extensions-are-bad.js.snap | 8 +- ...s@error.hooks-with-React-namespace.js.snap | 2 +- ...error.invalid-assign-hook-to-local.js.snap | 2 +- ...invalid-capture-func-passed-to-jsx.js.snap | 2 +- ...lid-computed-store-to-frozen-value.js.snap | 2 +- ...-unconditional-set-state-in-render.js.snap | 6 +- ...-global-increment-op-invalid-react.js.snap | 2 +- ...t__fixtures@error.todo-kitchensink.js.snap | 32 +-- ...odo-unconditional-set-state-lambda.js.snap | 8 +- ...rror.while-with-assignment-in-test.js.snap | 10 +- ...expression-with-assignment-dynamic.js.snap | 2 +- ...ixtures@expression-with-assignment.js.snap | 4 +- ...er_test__fixtures@extend-scopes-if.js.snap | 2 +- ...res@fbt-template-string-same-scope.js.snap | 2 +- ...res@for-empty-update-with-continue.js.snap | 6 +- ...er_test__fixtures@for-empty-update.js.snap | 6 +- .../parser_test__fixtures@for-logical.js.snap | 8 +- ...parser_test__fixtures@for-of-break.js.snap | 4 +- ..._fixtures@for-of-conditional-break.js.snap | 6 +- ...ser_test__fixtures@for-of-continue.js.snap | 12 +- ..._test__fixtures@for-of-destructure.js.snap | 8 +- ...arser_test__fixtures@for-of-simple.js.snap | 8 +- .../parser_test__fixtures@for-return.js.snap | 2 +- .../parser_test__fixtures@holey-array.js.snap | 2 +- ...test__fixtures@infer-phi-primitive.js.snap | 4 +- ...infer-types-through-type-cast.flow.js.snap | 2 +- ...fixtures@lambda-reassign-primitive.js.snap | 4 +- ...lambda-reassign-shadowed-primitive.js.snap | 4 +- ...@obj-literal-mutated-after-if-else.js.snap | 2 +- ...j-mutated-after-if-else-with-alias.js.snap | 2 +- ...fixtures@obj-mutated-after-if-else.js.snap | 2 +- ...ed-after-nested-if-else-with-alias.js.snap | 2 +- ...@object-computed-access-assignment.js.snap | 6 +- ...ures@optional-computed-load-static.js.snap | 2 +- ...ures@primitive-as-dep-nested-scope.js.snap | 2 +- ...er_test__fixtures@primitive-as-dep.js.snap | 2 +- ...res@property-call-evaluation-order.js.snap | 2 +- ...ser_test__fixtures@reactive-scopes.js.snap | 2 +- ...tive-via-mutation-of-computed-load.js.snap | 2 +- ...tive-via-mutation-of-property-load.js.snap | 2 +- ...ures@reassign-primitive-in-context.js.snap | 2 +- ...hi-in-returned-function-expression.js.snap | 2 +- ...tures@reassignment-separate-scopes.js.snap | 2 +- ...-cond-deps-cfg-switch-missing-case.js.snap | 6 +- ...nd-deps-cfg-switch-missing-default.js.snap | 4 +- ...duce-reactive-cond-deps-cfg-switch.js.snap | 4 +- ...ref-current-write-not-added-to-dep.js.snap | 2 +- ...@repro-scope-missing-mutable-range.js.snap | 4 +- ...r_test__fixtures@reverse-postorder.js.snap | 6 +- ...test__fixtures@sequence-expression.js.snap | 6 +- ...nt-progagatable-if-test-conditions.js.snap | 10 +- .../parser_test__fixtures@simple.js.snap | 2 +- ...tures@sketchy-code-exhaustive-deps.js.snap | 2 +- ...test__fixtures@ssa-arrayexpression.js.snap | 4 +- ...ures@ssa-cascading-eliminated-phis.js.snap | 6 +- ...__fixtures@ssa-complex-multiple-if.js.snap | 12 +- ...st__fixtures@ssa-complex-single-if.js.snap | 8 +- .../parser_test__fixtures@ssa-for-of.js.snap | 4 +- ...t__fixtures@ssa-for-trivial-update.js.snap | 8 +- .../parser_test__fixtures@ssa-for.js.snap | 8 +- .../parser_test__fixtures@ssa-if-else.js.snap | 4 +- ...r_test__fixtures@ssa-multiple-phis.js.snap | 2 +- ...tures@ssa-nested-loops-no-reassign.js.snap | 4 +- ...fixtures@ssa-non-empty-initializer.js.snap | 2 +- ..._fixtures@ssa-objectexpression-phi.js.snap | 10 +- ...est__fixtures@ssa-objectexpression.js.snap | 4 +- ...est__fixtures@ssa-reassign-in-rval.js.snap | 2 +- ...parser_test__fixtures@ssa-reassign.js.snap | 2 +- .../parser_test__fixtures@ssa-return.js.snap | 6 +- ...er_test__fixtures@ssa-sibling-phis.js.snap | 2 +- ...rser_test__fixtures@ssa-simple-phi.js.snap | 8 +- .../parser_test__fixtures@ssa-simple.js.snap | 4 +- ...arser_test__fixtures@ssa-single-if.js.snap | 4 +- .../parser_test__fixtures@ssa-switch.js.snap | 12 +- .../parser_test__fixtures@ssa-throw.js.snap | 6 +- ...st__fixtures@ssa-while-no-reassign.js.snap | 6 +- .../parser_test__fixtures@ssa-while.js.snap | 6 +- ..._fixtures@switch-non-final-default.js.snap | 2 +- ...__fixtures@switch-with-fallthrough.js.snap | 24 +- ...ures@ternary-assignment-expression.js.snap | 6 +- ...ser_test__fixtures@type-field-load.js.snap | 2 +- ...test__fixtures@type-test-primitive.js.snap | 4 +- ...fixtures@unconditional-break-label.js.snap | 4 +- ..._test__fixtures@unused-conditional.js.snap | 6 +- ...rser_test__fixtures@unused-logical.js.snap | 6 +- ...test__fixtures@use-callback-simple.js.snap | 4 +- ...arser_test__fixtures@while-logical.js.snap | 4 +- ...rser_test__fixtures@while-property.js.snap | 2 +- .../crates/forget_hir/src/instruction.rs | 150 +---------- .../forget/crates/forget_hir/src/print.rs | 13 +- .../src/constant_propagation.rs | 38 +-- 150 files changed, 602 insertions(+), 592 deletions(-) diff --git a/compiler/forget/Cargo.lock b/compiler/forget/Cargo.lock index 5c2b5456cd..5f2101c497 100644 --- a/compiler/forget/Cargo.lock +++ b/compiler/forget/Cargo.lock @@ -515,7 +515,7 @@ version = "0.1.0" dependencies = [ "forget_build_hir", "forget_estree", - "forget_estree_swc", + "forget_hermes_parser", "forget_hir", "forget_optimization", "forget_semantic_analysis", diff --git a/compiler/forget/crates/forget_build_hir/src/build.rs b/compiler/forget/crates/forget_build_hir/src/build.rs index db67841706..a7913e6495 100644 --- a/compiler/forget/crates/forget_build_hir/src/build.rs +++ b/compiler/forget/crates/forget_build_hir/src/build.rs @@ -4,13 +4,13 @@ use forget_diagnostics::Diagnostic; use forget_estree::{ AssignmentTarget, BinaryExpression, BlockStatement, Expression, ExpressionOrSpread, ExpressionOrSuper, ForInit, ForStatement, Function, FunctionExpression, IfStatement, - IntoFunction, JsValue, Literal, Pattern, Statement, VariableDeclaration, + IntoFunction, JsValue, Literal, Number, Pattern, Statement, VariableDeclaration, VariableDeclarationKind, }; use forget_hir::{ BlockKind, BranchTerminal, Environment, ForTerminal, GotoKind, IdentifierOperand, InstrIx, InstructionKind, InstructionValue, JSXAttribute, JSXElement, LValue, LoadGlobal, LoadLocal, - Operand, PlaceOrSpread, PrimitiveValue, TerminalValue, + Operand, PlaceOrSpread, TerminalValue, }; use crate::builder::{Binding, Builder, LoopScope}; @@ -66,7 +66,7 @@ pub fn build(env: &Environment, fun: &Function) -> Result lower_expression(env, builder, argument)?, None => builder.push(InstructionValue::Primitive(forget_hir::Primitive { - value: PrimitiveValue::Undefined, + value: JsValue::Undefined, })), }; builder.terminate( @@ -351,7 +351,19 @@ fn lower_expression( } } Expression::Literal(expr) => InstructionValue::Primitive(forget_hir::Primitive { - value: lower_primitive(env, builder, expr), + value: expr.value.clone(), + }), + Expression::NumericLiteral(expr) => InstructionValue::Primitive(forget_hir::Primitive { + value: JsValue::Number(expr.value), + }), + Expression::BooleanLiteral(expr) => InstructionValue::Primitive(forget_hir::Primitive { + value: JsValue::Boolean(expr.value), + }), + Expression::StringLiteral(expr) => InstructionValue::Primitive(forget_hir::Primitive { + value: JsValue::String(expr.value.clone()), + }), + Expression::NullLiteral(_expr) => InstructionValue::Primitive(forget_hir::Primitive { + value: JsValue::Null, }), Expression::ArrayExpression(expr) => { let mut elements = Vec::with_capacity(expr.elements.len()); @@ -621,18 +633,3 @@ fn lower_identifier_for_assignment( } } } - -/// Converts an ESTree literal into a HIR primitive -fn lower_primitive( - _env: &Environment, - _builder: &mut Builder, - literal: &Literal, -) -> PrimitiveValue { - match &literal.value { - JsValue::Bool(bool) => PrimitiveValue::Boolean(*bool), - JsValue::Null => PrimitiveValue::Null, - JsValue::Number(value) => PrimitiveValue::Number(f64::from(*value).into()), - JsValue::String(s) => PrimitiveValue::String(s.clone()), - _ => todo!("Lower literal {literal:#?}"), - } -} diff --git a/compiler/forget/crates/forget_estree/src/js_value.rs b/compiler/forget/crates/forget_estree/src/js_value.rs index 8f0fdfd92a..48471a3a17 100644 --- a/compiler/forget/crates/forget_estree/src/js_value.rs +++ b/compiler/forget/crates/forget_estree/src/js_value.rs @@ -1,50 +1,82 @@ use serde::de::Visitor; use serde::{Deserialize, Serialize}; -#[derive(Serialize, Clone, Debug, PartialEq, PartialOrd, Hash)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum JsValue { - Undefined, + Boolean(bool), Null, - Bool(bool), Number(Number), String(String), + Undefined, } -#[derive( - Clone, - Copy, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - Serialize, - Deserialize, - Debug -)] -pub struct Number(u64); +impl JsValue { + pub fn is_truthy(&self) -> bool { + match &self { + JsValue::Boolean(value) => *value, + JsValue::Number(value) => value.is_truthy(), + JsValue::String(value) => value.len() != 0, + JsValue::Null => false, + JsValue::Undefined => false, + } + } -impl From for Number { - fn from(value: u32) -> Self { - Number(value.into()) + // Partial implementation of loose equality for javascript, returns Some for supported + // cases w the equality result, and None for unsupported cases + pub fn loosely_equals(&self, other: &Self) -> Option { + // https://tc39.es/ecma262/multipage/abstract-operations.html#sec-islooselyequal + match (&self, &other) { + // 1. If Type(x) is Type(y), then + // a. Return IsStrictlyEqual(x, y). + (JsValue::Number(left), JsValue::Number(right)) => Some(left.equals(*right)), + (JsValue::Null, JsValue::Null) => Some(true), + (JsValue::Undefined, JsValue::Undefined) => Some(true), + (JsValue::Boolean(left), JsValue::Boolean(right)) => Some(left == right), + (JsValue::String(left), JsValue::String(right)) => Some(left == right), + + // 2. If x is null and y is undefined, return true. + (JsValue::Null, JsValue::Undefined) => Some(true), + + // 3. If x is undefined and y is null, return true. + (JsValue::Undefined, JsValue::Null) => Some(true), + _ => None, + } + } + + pub fn not_loosely_equals(&self, other: &Self) -> Option { + self.loosely_equals(other).map(|value| !value) + } + + // Complete implementation of strict equality for javascript + pub fn strictly_equals(&self, other: &Self) -> bool { + // https://tc39.es/ecma262/multipage/abstract-operations.html#sec-isstrictlyequal + match (&self, &other) { + (JsValue::Number(left), JsValue::Number(right)) => left.equals(*right), + (JsValue::Null, JsValue::Null) => true, + (JsValue::Undefined, JsValue::Undefined) => true, + (JsValue::Boolean(left), JsValue::Boolean(right)) => left == right, + (JsValue::String(left), JsValue::String(right)) => left == right, + _ => false, + } + } + + pub fn not_strictly_equals(&self, other: &Self) -> bool { + !self.strictly_equals(other) } } -impl From for Number { - fn from(value: u64) -> Self { - Number(value) - } -} - -impl From for Number { - fn from(value: f64) -> Self { - Number(value.to_bits()) - } -} - -impl From for f64 { - fn from(value: Number) -> Self { - f64::from_bits(value.0) +impl Serialize for JsValue { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + Self::Boolean(b) => serializer.serialize_bool(*b), + Self::Null => serializer.serialize_none(), + Self::Number(n) => serializer.serialize_f64(n.into()), + Self::String(s) => serializer.serialize_str(s), + Self::Undefined => serializer.serialize_unit(), + } } } @@ -65,13 +97,13 @@ impl<'de> Deserialize<'de> for JsValue { #[inline] fn visit_bool(self, value: bool) -> Result { - Ok(JsValue::Bool(value)) + Ok(JsValue::Boolean(value)) } #[inline] fn visit_i64(self, value: i64) -> Result { - if value < u32::MAX as i64 { - Ok(JsValue::Number((value as u32).into())) + if value >= MIN_SAFE_INT && value <= MAX_SAFE_INT { + Ok(JsValue::Number((value as f64).into())) } else { panic!("Invalid number") } @@ -79,7 +111,11 @@ impl<'de> Deserialize<'de> for JsValue { #[inline] fn visit_u64(self, value: u64) -> Result { - Ok(JsValue::Number(value.into())) + if value as i64 <= MAX_SAFE_INT { + Ok(JsValue::Number((value as f64).into())) + } else { + panic!("Invalid number") + } } #[inline] @@ -122,3 +158,135 @@ impl<'de> Deserialize<'de> for JsValue { deserializer.deserialize_any(ValueVisitor) } } + +/// Represents a JavaScript Number as its binary representation so that +/// -1 == -1, NaN == Nan etc. +/// Note: NaN is *always* represented as the f64::NAN constant to allow +/// comparison of NaNs. +#[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Debug, Hash)] +pub struct Number(u64); + +pub const MAX_SAFE_INT: i64 = 9007199254740991; +pub const MIN_SAFE_INT: i64 = -9007199254740991; + +impl From for Number { + fn from(value: f64) -> Self { + if value.is_nan() { + Self(f64::NAN.to_bits()) + } else { + Self(value.to_bits()) + } + } +} + +impl From for Number { + fn from(value: u32) -> Self { + f64::from(value).into() + } +} + +impl From for f64 { + fn from(number: Number) -> Self { + let value = f64::from_bits(number.0); + assert!(!f64::is_nan(value) || number.0 == f64::NAN.to_bits()); + value + } +} + +impl From<&Number> for f64 { + fn from(number: &Number) -> Self { + let value = f64::from_bits(number.0); + assert!(!f64::is_nan(value) || number.0 == f64::NAN.to_bits()); + value + } +} + +impl Number { + pub fn equals(self, other: Self) -> bool { + f64::from(self) == f64::from(other) + } + + pub fn not_equals(self, other: Self) -> bool { + !self.equals(other) + } + + pub fn is_truthy(self) -> bool { + let value = f64::from(self); + if self.0 == f64::NAN.to_bits() || value == 0.0 || value == -0.0 { + false + } else { + true + } + } +} + +impl std::ops::Add for Number { + type Output = Number; + + fn add(self, rhs: Self) -> Self::Output { + let result = f64::from(self) + f64::from(rhs); + Self::from(result) + } +} + +impl std::ops::Sub for Number { + type Output = Number; + + fn sub(self, rhs: Self) -> Self::Output { + let result = f64::from(self) - f64::from(rhs); + Self::from(result) + } +} + +impl std::ops::Mul for Number { + type Output = Number; + + fn mul(self, rhs: Self) -> Self::Output { + let result = f64::from(self) * f64::from(rhs); + Self::from(result) + } +} + +impl std::ops::Div for Number { + type Output = Number; + + fn div(self, rhs: Self) -> Self::Output { + let result = f64::from(self) / f64::from(rhs); + Self::from(result) + } +} + +impl Serialize for Number { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_f64(self.into()) + } +} + +impl<'de> Deserialize<'de> for Number { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + struct ValueVisitor; + + impl<'de> Visitor<'de> for ValueVisitor { + type Value = Number; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("value JavaScript number value") + } + + fn visit_f64(self, v: f64) -> Result + where + E: serde::de::Error, + { + Ok(v.into()) + } + } + + deserializer.deserialize_any(ValueVisitor) + } +} diff --git a/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@for-statement.json.snap b/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@for-statement.json.snap index 7a3dc79c2f..8727d72d14 100644 --- a/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@for-statement.json.snap +++ b/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@for-statement.json.snap @@ -612,9 +612,7 @@ Output: }, "init": { "type": "Literal", - "value": { - "Number": 0 - }, + "value": 0.0, "raw": "0", "regex": null, "bigint": null, @@ -697,9 +695,7 @@ Output: }, "init": { "type": "Literal", - "value": { - "Number": 0 - }, + "value": 0.0, "raw": "0", "regex": null, "bigint": null, @@ -777,9 +773,7 @@ Output: "operator": "<", "right": { "type": "Literal", - "value": { - "Number": 10 - }, + "value": 10.0, "raw": "10", "regex": null, "bigint": null, diff --git a/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@import.json.snap b/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@import.json.snap index dd08fcfdf2..825b9122bd 100644 --- a/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@import.json.snap +++ b/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@import.json.snap @@ -157,9 +157,7 @@ Output: ], "source": { "type": "Literal", - "value": { - "String": "react" - }, + "value": "react", "raw": "'react'", "regex": null, "bigint": null, diff --git a/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@test.json.snap b/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@test.json.snap index ca325475a3..5f07ae17e3 100644 --- a/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@test.json.snap +++ b/compiler/forget/crates/forget_estree/src/snapshots/forget_estree__tests__fixtures@test.json.snap @@ -474,9 +474,7 @@ Output: "type": "JSXExpressionContainer", "expression": { "type": "Literal", - "value": { - "Number": 10 - }, + "value": 10.0, "raw": "10", "regex": null, "bigint": null, diff --git a/compiler/forget/crates/forget_estree_swc/src/lib.rs b/compiler/forget/crates/forget_estree_swc/src/lib.rs index ab0fa810c3..86492d7d55 100644 --- a/compiler/forget/crates/forget_estree_swc/src/lib.rs +++ b/compiler/forget/crates/forget_estree_swc/src/lib.rs @@ -676,7 +676,7 @@ fn convert_jsx_attribute(cx: &Context, attr: &JSXAttr) -> forget_estree::JSXAttr fn convert_literal(_cx: &Context, expr: &Lit) -> forget_estree::Literal { let (value, range, regex, bigint) = match expr { Lit::Bool(expr) => ( - forget_estree::JsValue::Bool(expr.value), + forget_estree::JsValue::Boolean(expr.value), convert_span(&expr.span), None, None, diff --git a/compiler/forget/crates/forget_fixtures/Cargo.toml b/compiler/forget/crates/forget_fixtures/Cargo.toml index 41fd185a8b..c5aac9c6bf 100644 --- a/compiler/forget/crates/forget_fixtures/Cargo.toml +++ b/compiler/forget/crates/forget_fixtures/Cargo.toml @@ -15,7 +15,7 @@ repository.workspace = true [dev-dependencies] insta = { workspace = true } forget_estree = { workspace = true } -forget_estree_swc = { workspace = true } +forget_hermes_parser = { workspace = true } forget_hir = { workspace = true } forget_optimization = { workspace = true } forget_semantic_analysis = { workspace = true } diff --git a/compiler/forget/crates/forget_fixtures/tests/fixtures_test.rs b/compiler/forget/crates/forget_fixtures/tests/fixtures_test.rs index 6059863c3b..b951333055 100644 --- a/compiler/forget/crates/forget_fixtures/tests/fixtures_test.rs +++ b/compiler/forget/crates/forget_fixtures/tests/fixtures_test.rs @@ -3,7 +3,7 @@ use std::fmt::Write; use forget_build_hir::build; use forget_estree::{ModuleItem, Statement}; -use forget_estree_swc::parse; +use forget_hermes_parser::parse; use forget_hir::{inline_use_memo, Environment, Features, Print, Registry}; use forget_optimization::constant_propagation; use forget_semantic_analysis::analyze; diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@allocating-primitive-as-dep-nested-scope.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@allocating-primitive-as-dep-nested-scope.js.snap index 3735fa2bd7..9fd1f6d620 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@allocating-primitive-as-dep-nested-scope.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@allocating-primitive-as-dep-nested-scope.js.snap @@ -208,7 +208,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@allocating-primitive-as-dep.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@allocating-primitive-as-dep.js.snap index 1332d371af..22aeb33e4f 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@allocating-primitive-as-dep.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@allocating-primitive-as-dep.js.snap @@ -128,7 +128,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-access-assignment.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-access-assignment.js.snap index c25e199d34..5f85211c1d 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-access-assignment.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-access-assignment.js.snap @@ -267,7 +267,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -295,7 +295,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -343,7 +343,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -359,7 +359,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -387,7 +387,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-at-mutate-after-capture.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-at-mutate-after-capture.js.snap index 718706842f..b0dd644ad0 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-at-mutate-after-capture.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-at-mutate-after-capture.js.snap @@ -68,7 +68,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4631107791820423168, + "value": 42.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-expression-spread.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-expression-spread.js.snap index 222ed60269..feb3b4bf35 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-expression-spread.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-expression-spread.js.snap @@ -62,7 +62,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-property-call.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-property-call.js.snap index 531fb3be7d..7de0a2e095 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-property-call.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@array-property-call.js.snap @@ -200,7 +200,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4631107791820423168, + "value": 42.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-expression-computed.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-expression-computed.js.snap index 0c005544eb..b1c4060abf 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-expression-computed.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-expression-computed.js.snap @@ -130,7 +130,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -186,7 +186,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -241,7 +241,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-expression-nested-path.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-expression-nested-path.js.snap index 045fc98e7e..92b3e46057 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-expression-nested-path.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-expression-nested-path.js.snap @@ -271,7 +271,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -352,7 +352,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations-complex-lvalue-array.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations-complex-lvalue-array.js.snap index 48fe8cc231..85c246bf94 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations-complex-lvalue-array.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations-complex-lvalue-array.js.snap @@ -56,7 +56,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -140,7 +140,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -203,7 +203,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -212,7 +212,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations-complex-lvalue.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations-complex-lvalue.js.snap index ff1d7458c1..11c35f41a6 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations-complex-lvalue.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations-complex-lvalue.js.snap @@ -80,7 +80,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -240,7 +240,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -321,7 +321,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations.js.snap index 7140d242d5..9f00136daf 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@assignment-variations.js.snap @@ -51,7 +51,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -101,7 +101,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -144,7 +144,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -181,7 +181,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@babel-existing-react-import.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@babel-existing-react-import.js.snap index 421a6e0b7b..4c46615099 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@babel-existing-react-import.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@babel-existing-react-import.js.snap @@ -168,7 +168,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -472,7 +472,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@babel-existing-react-kitchensink-import.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@babel-existing-react-kitchensink-import.js.snap index 0551543f1b..509f7b4a1d 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@babel-existing-react-kitchensink-import.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@babel-existing-react-kitchensink-import.js.snap @@ -206,7 +206,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -510,7 +510,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture-indirect-mutate-alias.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture-indirect-mutate-alias.js.snap index f1afd6c53a..0bb58bbbba 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture-indirect-mutate-alias.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture-indirect-mutate-alias.js.snap @@ -216,7 +216,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture-param-mutate.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture-param-mutate.js.snap index 49966576fc..b4a3867f05 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture-param-mutate.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture-param-mutate.js.snap @@ -152,7 +152,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -185,7 +185,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -259,7 +259,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -455,7 +455,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 4621819117588971520, + "value": 10.0, "loc": null, "range": { "start": 0, @@ -609,7 +609,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -757,7 +757,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -766,7 +766,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4621256167635550208, + "value": 9.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture_mutate-across-fns.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture_mutate-across-fns.js.snap index ab479767bb..32865b46e1 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture_mutate-across-fns.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capture_mutate-across-fns.js.snap @@ -175,7 +175,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-2.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-2.js.snap index 0a32262fef..10ebd2b56b 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-2.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-2.js.snap @@ -258,7 +258,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-3.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-3.js.snap index eb0cc9809d..5c5684fce5 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-3.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-3.js.snap @@ -257,7 +257,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-nested.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-nested.js.snap index 3efc740228..733e5be2c3 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-nested.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate-nested.js.snap @@ -226,7 +226,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate.js.snap index d3e2ded34d..fae43cdfc9 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-func-mutate.js.snap @@ -258,7 +258,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-2.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-2.js.snap index feab7a9cfe..19c190049f 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-2.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-2.js.snap @@ -175,7 +175,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -191,7 +191,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-3.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-3.js.snap index 7cb82b064a..0feec9c2df 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-3.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-3.js.snap @@ -235,7 +235,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -251,7 +251,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -309,7 +309,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -325,7 +325,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-4.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-4.js.snap index 2f704c3448..a9e7469ba0 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-4.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load-4.js.snap @@ -177,7 +177,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -210,7 +210,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load.js.snap index c717498225..aee2249135 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-function-alias-computed-load.js.snap @@ -173,7 +173,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-reference-changes-type.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-reference-changes-type.js.snap index 0bf566934c..234113f353 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-reference-changes-type.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@capturing-reference-changes-type.js.snap @@ -135,7 +135,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@chained-assignment-expressions.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@chained-assignment-expressions.js.snap index fd581ef5e2..90f877509d 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@chained-assignment-expressions.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@chained-assignment-expressions.js.snap @@ -67,7 +67,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -137,7 +137,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -207,7 +207,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -312,7 +312,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -438,7 +438,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@component.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@component.js.snap index 2b595a0ea3..178551aee0 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@component.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@component.js.snap @@ -315,7 +315,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -372,7 +372,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -455,7 +455,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@computed-call-evaluation-order.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@computed-call-evaluation-order.js.snap index e778a96697..34e3927469 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@computed-call-evaluation-order.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@computed-call-evaluation-order.js.snap @@ -580,7 +580,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@computed-load-primitive-as-dependency.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@computed-load-primitive-as-dependency.js.snap index bbdca9fc43..3e203ecbbc 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@computed-load-primitive-as-dependency.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@computed-load-primitive-as-dependency.js.snap @@ -249,7 +249,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@concise-arrow-expr.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@concise-arrow-expr.js.snap index de65b4af0f..529d7663ac 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@concise-arrow-expr.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@concise-arrow-expr.js.snap @@ -82,7 +82,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@conditional-set-state-in-render.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@conditional-set-state-in-render.js.snap index 5e7756df95..4419b74968 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@conditional-set-state-in-render.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@conditional-set-state-in-render.js.snap @@ -102,7 +102,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -169,7 +169,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -275,7 +275,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@const-propagation-into-function-expression-primitive.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@const-propagation-into-function-expression-primitive.js.snap index 98d2af2560..75d612d679 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@const-propagation-into-function-expression-primitive.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@const-propagation-into-function-expression-primitive.js.snap @@ -52,7 +52,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4631107791820423168, + "value": 42.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-for.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-for.js.snap index 7c2adc405d..fcdaa3fa13 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-for.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-for.js.snap @@ -51,7 +51,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -91,7 +91,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4636737291354636288, + "value": 100.0, "loc": null, "range": { "start": 0, @@ -126,7 +126,7 @@ Output: "operator": "<", "right": { "type": "NumericLiteral", - "value": 4621819117588971520, + "value": 10.0, "loc": null, "range": { "start": 0, @@ -182,7 +182,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-into-function-expressions.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-into-function-expressions.js.snap index 83e4636ffa..4b930f184c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-into-function-expressions.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-into-function-expressions.js.snap @@ -62,7 +62,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4631107791820423168, + "value": 42.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-phi.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-phi.js.snap index 3cf0907a3e..6a4709dde8 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-phi.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-phi.js.snap @@ -134,7 +134,7 @@ Output: "type": "BinaryExpression", "left": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -144,7 +144,7 @@ Output: "operator": "-", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -199,7 +199,7 @@ Output: "type": "BinaryExpression", "left": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -209,7 +209,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -265,7 +265,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-while.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-while.js.snap index 4095095d0a..a6aec995ef 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-while.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation-while.js.snap @@ -52,7 +52,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4636737291354636288, + "value": 100.0, "loc": null, "range": { "start": 0, @@ -90,7 +90,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -127,7 +127,7 @@ Output: "operator": "<", "right": { "type": "NumericLiteral", - "value": 4621819117588971520, + "value": 10.0, "loc": null, "range": { "start": 0, @@ -160,7 +160,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation.js.snap index 2ad8006d35..c50d473b04 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@constant-propagation.js.snap @@ -62,7 +62,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -100,7 +100,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -138,7 +138,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@controlled-input.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@controlled-input.js.snap index a32f52a6eb..c642e8e47c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@controlled-input.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@controlled-input.js.snap @@ -82,7 +82,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@dce-loop.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@dce-loop.js.snap index d289e7aa85..148202da51 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@dce-loop.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@dce-loop.js.snap @@ -64,7 +64,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -102,7 +102,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@declare-reassign-variable-in-function-declaration.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@declare-reassign-variable-in-function-declaration.js.snap index c0caedf0a7..ebb95b9158 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@declare-reassign-variable-in-function-declaration.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@declare-reassign-variable-in-function-declaration.js.snap @@ -104,7 +104,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4621256167635550208, + "value": 9.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@destructuring-array-param-default.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@destructuring-array-param-default.js.snap index 2abe5e9c67..91c42b8fc4 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@destructuring-array-param-default.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@destructuring-array-param-default.js.snap @@ -43,7 +43,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@destructuring-object-param-default.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@destructuring-object-param-default.js.snap index b85a1bc751..1bf5bf7160 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@destructuring-object-param-default.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@destructuring-object-param-default.js.snap @@ -55,7 +55,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-compound-test.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-compound-test.js.snap index d5f22e0f3c..2c9d9614c5 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-compound-test.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-compound-test.js.snap @@ -67,7 +67,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -76,7 +76,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -85,7 +85,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -271,7 +271,7 @@ Output: "operator": "*", "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-conditional-break.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-conditional-break.js.snap index c24518b0f1..dd58896e4e 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-conditional-break.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-conditional-break.js.snap @@ -68,7 +68,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -77,7 +77,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -86,7 +86,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -95,7 +95,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -144,7 +144,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-continue.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-continue.js.snap index ace8fac55b..a28b7c6bad 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-continue.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-continue.js.snap @@ -60,7 +60,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -69,7 +69,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -78,7 +78,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -87,7 +87,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -241,7 +241,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -329,7 +329,7 @@ Output: "operator": "/", "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-early-unconditional-break.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-early-unconditional-break.js.snap index e935525b3d..3131c3fb26 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-early-unconditional-break.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-early-unconditional-break.js.snap @@ -66,7 +66,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -75,7 +75,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -84,7 +84,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-simple.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-simple.js.snap index 34212f7008..aec2669ec0 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-simple.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@do-while-simple.js.snap @@ -56,7 +56,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -65,7 +65,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -74,7 +74,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -260,7 +260,7 @@ Output: "operator": "*", "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@dominator.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@dominator.js.snap index 0058395818..5d1fe6fe11 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@dominator.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@dominator.js.snap @@ -88,7 +88,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -171,7 +171,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -252,7 +252,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -330,7 +330,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -445,7 +445,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4616189618054758400, + "value": 4.0, "loc": null, "range": { "start": 0, @@ -567,7 +567,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4617315517961601024, + "value": 5.0, "loc": null, "range": { "start": 0, @@ -625,7 +625,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4618441417868443648, + "value": 6.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@early-return.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@early-return.js.snap index f0ce1de84b..9ac2d9ac0c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@early-return.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@early-return.js.snap @@ -145,7 +145,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.babel-existing-react-namespace-import.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.babel-existing-react-namespace-import.js.snap index b5f0d2a291..171a9c26d9 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.babel-existing-react-namespace-import.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.babel-existing-react-namespace-import.js.snap @@ -149,7 +149,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -491,7 +491,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.bug-validate-no-set-state-not-all-mutable-range-extensions-are-bad.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.bug-validate-no-set-state-not-all-mutable-range-extensions-are-bad.js.snap index 50356ee380..71455cf942 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.bug-validate-no-set-state-not-all-mutable-range-extensions-are-bad.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.bug-validate-no-set-state-not-all-mutable-range-extensions-are-bad.js.snap @@ -190,7 +190,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -307,7 +307,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -379,7 +379,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -502,7 +502,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.hooks-with-React-namespace.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.hooks-with-React-namespace.js.snap index 952d2e4b3d..b0126a44f0 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.hooks-with-React-namespace.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.hooks-with-React-namespace.js.snap @@ -100,7 +100,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-assign-hook-to-local.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-assign-hook-to-local.js.snap index 69af7c0968..68cc5bdaee 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-assign-hook-to-local.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-assign-hook-to-local.js.snap @@ -154,7 +154,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-capture-func-passed-to-jsx.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-capture-func-passed-to-jsx.js.snap index e105460970..6f9577a33c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-capture-func-passed-to-jsx.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-capture-func-passed-to-jsx.js.snap @@ -259,7 +259,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-computed-store-to-frozen-value.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-computed-store-to-frozen-value.js.snap index decaad9cdb..3e27d2bcff 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-computed-store-to-frozen-value.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-computed-store-to-frozen-value.js.snap @@ -184,7 +184,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-unconditional-set-state-in-render.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-unconditional-set-state-in-render.js.snap index 8d972e0858..fc9c95bc1c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-unconditional-set-state-in-render.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.invalid-unconditional-set-state-in-render.js.snap @@ -97,7 +97,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -180,7 +180,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -218,7 +218,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.mutate-global-increment-op-invalid-react.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.mutate-global-increment-op-invalid-react.js.snap index 03b3aab8e1..c8a7637af4 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.mutate-global-increment-op-invalid-react.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.mutate-global-increment-op-invalid-react.js.snap @@ -34,7 +34,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.todo-kitchensink.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.todo-kitchensink.js.snap index 0da2b0676e..7035b1f8e8 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.todo-kitchensink.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.todo-kitchensink.js.snap @@ -313,7 +313,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -401,7 +401,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 4631107791820423168, + "value": 42.0, "loc": null, "range": { "start": 0, @@ -855,7 +855,7 @@ Output: "type": "JSXExpressionContainer", "expression": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -1115,7 +1115,7 @@ Output: "operator": "<", "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -1143,7 +1143,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -1248,7 +1248,7 @@ Output: "operator": "<", "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -1461,7 +1461,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -1470,7 +1470,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -1530,7 +1530,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -1549,7 +1549,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -1650,7 +1650,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -1691,7 +1691,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -1786,7 +1786,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -1843,7 +1843,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -2036,7 +2036,7 @@ Output: "type": "BinaryExpression", "left": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -2046,7 +2046,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.todo-unconditional-set-state-lambda.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.todo-unconditional-set-state-lambda.js.snap index 6214d9de55..fe3effe953 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.todo-unconditional-set-state-lambda.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.todo-unconditional-set-state-lambda.js.snap @@ -67,7 +67,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -138,7 +138,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -205,7 +205,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -243,7 +243,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.while-with-assignment-in-test.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.while-with-assignment-in-test.js.snap index 484cf852cb..4bf1f6845c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.while-with-assignment-in-test.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@error.while-with-assignment-in-test.js.snap @@ -68,7 +68,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -77,7 +77,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -86,7 +86,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -131,7 +131,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -169,7 +169,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@expression-with-assignment-dynamic.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@expression-with-assignment-dynamic.js.snap index 7fb096e3dd..c004da6f52 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@expression-with-assignment-dynamic.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@expression-with-assignment-dynamic.js.snap @@ -112,7 +112,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@expression-with-assignment.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@expression-with-assignment.js.snap index cfebb3fc27..8b482639dd 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@expression-with-assignment.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@expression-with-assignment.js.snap @@ -48,7 +48,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -100,7 +100,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@extend-scopes-if.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@extend-scopes-if.js.snap index 58f357f054..20bffb4ceb 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@extend-scopes-if.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@extend-scopes-if.js.snap @@ -190,7 +190,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@fbt-template-string-same-scope.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@fbt-template-string-same-scope.js.snap index 8cdd71bd8f..7de5fc3624 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@fbt-template-string-same-scope.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@fbt-template-string-same-scope.js.snap @@ -111,7 +111,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-empty-update-with-continue.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-empty-update-with-continue.js.snap index 80a60ed1d6..a05cd7fe03 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-empty-update-with-continue.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-empty-update-with-continue.js.snap @@ -64,7 +64,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -104,7 +104,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -231,7 +231,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-empty-update.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-empty-update.js.snap index d91c39f2f1..6be6cd5229 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-empty-update.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-empty-update.js.snap @@ -65,7 +65,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -105,7 +105,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -232,7 +232,7 @@ Output: "operator": ">", "right": { "type": "NumericLiteral", - "value": 4621819117588971520, + "value": 10.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-logical.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-logical.js.snap index 15b5f0d164..c394cfd690 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-logical.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-logical.js.snap @@ -67,7 +67,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -107,7 +107,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -278,7 +278,7 @@ Output: }, "alternate": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -346,7 +346,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-break.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-break.js.snap index 8667dc1180..ac9c3a9b4b 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-break.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-break.js.snap @@ -109,7 +109,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -118,7 +118,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-conditional-break.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-conditional-break.js.snap index f71fc877d9..9fb02f4a6e 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-conditional-break.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-conditional-break.js.snap @@ -112,7 +112,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -121,7 +121,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -155,7 +155,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-continue.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-continue.js.snap index 90d35eb0ed..8c4aefe81e 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-continue.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-continue.js.snap @@ -58,7 +58,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -67,7 +67,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -76,7 +76,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -85,7 +85,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -213,7 +213,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -301,7 +301,7 @@ Output: "operator": "/", "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-destructure.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-destructure.js.snap index 7508308225..ae35dfdc91 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-destructure.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-destructure.js.snap @@ -108,7 +108,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -149,7 +149,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -190,7 +190,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -361,7 +361,7 @@ Output: "operator": "*", "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-simple.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-simple.js.snap index a53aafec4c..28e6787bac 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-simple.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-of-simple.js.snap @@ -93,7 +93,7 @@ Output: "elements": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -102,7 +102,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -111,7 +111,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -233,7 +233,7 @@ Output: "operator": "*", "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-return.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-return.js.snap index e8a431d2fe..05644c8ba3 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-return.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@for-return.js.snap @@ -62,7 +62,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@holey-array.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@holey-array.js.snap index 740e89a9f6..6d2ed6b9af 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@holey-array.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@holey-array.js.snap @@ -118,7 +118,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@infer-phi-primitive.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@infer-phi-primitive.js.snap index 33180f871b..4ed5c4cbfa 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@infer-phi-primitive.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@infer-phi-primitive.js.snap @@ -120,7 +120,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -167,7 +167,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@infer-types-through-type-cast.flow.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@infer-types-through-type-cast.flow.js.snap index 49e2a48e34..ab022027d3 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@infer-types-through-type-cast.flow.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@infer-types-through-type-cast.flow.js.snap @@ -165,7 +165,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@lambda-reassign-primitive.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@lambda-reassign-primitive.js.snap index 3eacae3d64..ccd731a2af 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@lambda-reassign-primitive.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@lambda-reassign-primitive.js.snap @@ -58,7 +58,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4630826316843712512, + "value": 40.0, "loc": null, "range": { "start": 0, @@ -131,7 +131,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@lambda-reassign-shadowed-primitive.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@lambda-reassign-shadowed-primitive.js.snap index f4eedcbdd3..c6a02e6b68 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@lambda-reassign-shadowed-primitive.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@lambda-reassign-shadowed-primitive.js.snap @@ -96,7 +96,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4633078116657397760, + "value": 56.0, "loc": null, "range": { "start": 0, @@ -156,7 +156,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4631107791820423168, + "value": 42.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-literal-mutated-after-if-else.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-literal-mutated-after-if-else.js.snap index f4cd70fe58..86227e227b 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-literal-mutated-after-if-else.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-literal-mutated-after-if-else.js.snap @@ -330,7 +330,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-if-else-with-alias.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-if-else-with-alias.js.snap index 9a45767936..6094c265be 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-if-else-with-alias.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-if-else-with-alias.js.snap @@ -374,7 +374,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-if-else.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-if-else.js.snap index 1a1fbcdf29..350b607b79 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-if-else.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-if-else.js.snap @@ -294,7 +294,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-nested-if-else-with-alias.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-nested-if-else-with-alias.js.snap index 5d2a437bba..00e507f3d5 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-nested-if-else-with-alias.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@obj-mutated-after-nested-if-else-with-alias.js.snap @@ -533,7 +533,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@object-computed-access-assignment.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@object-computed-access-assignment.js.snap index 6682284b9d..ae45718e8c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@object-computed-access-assignment.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@object-computed-access-assignment.js.snap @@ -216,7 +216,7 @@ Output: "type": "BinaryExpression", "left": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -226,7 +226,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -273,7 +273,7 @@ Output: "operator": "*", "right": { "type": "NumericLiteral", - "value": 4616189618054758400, + "value": 4.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@optional-computed-load-static.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@optional-computed-load-static.js.snap index 92327e4123..eba2af859a 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@optional-computed-load-static.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@optional-computed-load-static.js.snap @@ -111,7 +111,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@primitive-as-dep-nested-scope.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@primitive-as-dep-nested-scope.js.snap index 33f5a2d404..f9d18e319d 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@primitive-as-dep-nested-scope.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@primitive-as-dep-nested-scope.js.snap @@ -189,7 +189,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@primitive-as-dep.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@primitive-as-dep.js.snap index a11ffb64c7..b94321983a 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@primitive-as-dep.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@primitive-as-dep.js.snap @@ -109,7 +109,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@property-call-evaluation-order.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@property-call-evaluation-order.js.snap index d4eebf9792..30e5a21725 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@property-call-evaluation-order.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@property-call-evaluation-order.js.snap @@ -522,7 +522,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactive-scopes.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactive-scopes.js.snap index 7b0fed0380..bae474b123 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactive-scopes.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactive-scopes.js.snap @@ -131,7 +131,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactivity-analysis-reactive-via-mutation-of-computed-load.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactivity-analysis-reactive-via-mutation-of-computed-load.js.snap index 0c2e9d8639..760b97c96d 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactivity-analysis-reactive-via-mutation-of-computed-load.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactivity-analysis-reactive-via-mutation-of-computed-load.js.snap @@ -262,7 +262,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactivity-analysis-reactive-via-mutation-of-property-load.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactivity-analysis-reactive-via-mutation-of-property-load.js.snap index 4cf35ce124..0457b60e44 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactivity-analysis-reactive-via-mutation-of-property-load.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reactivity-analysis-reactive-via-mutation-of-property-load.js.snap @@ -243,7 +243,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassign-primitive-in-context.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassign-primitive-in-context.js.snap index c4301d1082..1ed0d4a8e3 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassign-primitive-in-context.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassign-primitive-in-context.js.snap @@ -63,7 +63,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4617315517961601024, + "value": 5.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassigned-phi-in-returned-function-expression.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassigned-phi-in-returned-function-expression.js.snap index 91be8e5d7b..e81fcdf3c1 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassigned-phi-in-returned-function-expression.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassigned-phi-in-returned-function-expression.js.snap @@ -150,7 +150,7 @@ Output: }, "property": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassignment-separate-scopes.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassignment-separate-scopes.js.snap index eca824dedf..38ba63e928 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassignment-separate-scopes.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reassignment-separate-scopes.js.snap @@ -317,7 +317,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch-missing-case.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch-missing-case.js.snap index 409a1d5a6c..77de087ddd 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch-missing-case.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch-missing-case.js.snap @@ -140,7 +140,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -263,7 +263,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -307,7 +307,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4631107791820423168, + "value": 42.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch-missing-default.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch-missing-default.js.snap index 789d248efd..956ca47d08 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch-missing-default.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch-missing-default.js.snap @@ -137,7 +137,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -260,7 +260,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch.js.snap index 68f049f30b..4f844df674 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reduce-reactive-cond-deps-cfg-switch.js.snap @@ -140,7 +140,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -263,7 +263,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ref-current-write-not-added-to-dep.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ref-current-write-not-added-to-dep.js.snap index 9f83af4102..f63be03f6b 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ref-current-write-not-added-to-dep.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ref-current-write-not-added-to-dep.js.snap @@ -141,7 +141,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@repro-scope-missing-mutable-range.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@repro-scope-missing-mutable-range.js.snap index b4d9200d19..bcd1083523 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@repro-scope-missing-mutable-range.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@repro-scope-missing-mutable-range.js.snap @@ -113,7 +113,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -311,7 +311,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reverse-postorder.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reverse-postorder.js.snap index fa88e846d6..b74f09b609 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reverse-postorder.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@reverse-postorder.js.snap @@ -164,7 +164,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -259,7 +259,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -354,7 +354,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sequence-expression.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sequence-expression.js.snap index e1579f0cb2..68a1330dc3 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sequence-expression.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sequence-expression.js.snap @@ -107,7 +107,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -116,7 +116,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -251,7 +251,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sequentially-constant-progagatable-if-test-conditions.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sequentially-constant-progagatable-if-test-conditions.js.snap index 4a55804864..dfa1b07064 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sequentially-constant-progagatable-if-test-conditions.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sequentially-constant-progagatable-if-test-conditions.js.snap @@ -78,7 +78,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -145,7 +145,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -479,7 +479,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4631107791820423168, + "value": 42.0, "loc": null, "range": { "start": 0, @@ -526,7 +526,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4631107932557911523, + "value": 42.001, "loc": null, "range": { "start": 0, @@ -606,7 +606,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4631107791820423168, + "value": 42.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@simple.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@simple.js.snap index 05f1599724..99499108b2 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@simple.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@simple.js.snap @@ -151,7 +151,7 @@ Output: "operator": "*", "right": { "type": "NumericLiteral", - "value": 4621819117588971520, + "value": 10.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sketchy-code-exhaustive-deps.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sketchy-code-exhaustive-deps.js.snap index 0d3d9295b0..14071d74f3 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sketchy-code-exhaustive-deps.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@sketchy-code-exhaustive-deps.js.snap @@ -147,7 +147,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-arrayexpression.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-arrayexpression.js.snap index a5bf5b791f..f6f7a7df6e 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-arrayexpression.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-arrayexpression.js.snap @@ -61,7 +61,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -99,7 +99,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-cascading-eliminated-phis.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-cascading-eliminated-phis.js.snap index a9becf40af..b8fe153ad0 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-cascading-eliminated-phis.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-cascading-eliminated-phis.js.snap @@ -70,7 +70,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -333,7 +333,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -476,7 +476,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-complex-multiple-if.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-complex-multiple-if.js.snap index 3758235083..a91df2ef44 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-complex-multiple-if.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-complex-multiple-if.js.snap @@ -56,7 +56,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -94,7 +94,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -131,7 +131,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -164,7 +164,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -215,7 +215,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -248,7 +248,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4617315517961601024, + "value": 5.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-complex-single-if.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-complex-single-if.js.snap index 5b19ec5f0b..0992e03d84 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-complex-single-if.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-complex-single-if.js.snap @@ -53,7 +53,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -91,7 +91,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -128,7 +128,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -161,7 +161,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for-of.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for-of.js.snap index 6b6e4540f4..2bfa0d8b7e 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for-of.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for-of.js.snap @@ -149,7 +149,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -201,7 +201,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for-trivial-update.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for-trivial-update.js.snap index 82549d5d8f..25ec4f30bc 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for-trivial-update.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for-trivial-update.js.snap @@ -51,7 +51,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -91,7 +91,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -126,7 +126,7 @@ Output: "operator": "<", "right": { "type": "NumericLiteral", - "value": 4621819117588971520, + "value": 10.0, "loc": null, "range": { "start": 0, @@ -169,7 +169,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for.js.snap index 7e2f9378e8..f02ccf634e 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-for.js.snap @@ -51,7 +51,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -91,7 +91,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -126,7 +126,7 @@ Output: "operator": "<", "right": { "type": "NumericLiteral", - "value": 4621819117588971520, + "value": 10.0, "loc": null, "range": { "start": 0, @@ -179,7 +179,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-if-else.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-if-else.js.snap index 605597bf4d..118ad9acee 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-if-else.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-if-else.js.snap @@ -54,7 +54,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -92,7 +92,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-multiple-phis.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-multiple-phis.js.snap index 5c18267209..a059203d6c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-multiple-phis.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-multiple-phis.js.snap @@ -104,7 +104,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-nested-loops-no-reassign.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-nested-loops-no-reassign.js.snap index a1d97f1800..dbc5149f51 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-nested-loops-no-reassign.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-nested-loops-no-reassign.js.snap @@ -87,7 +87,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -169,7 +169,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-non-empty-initializer.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-non-empty-initializer.js.snap index aa175c9e1e..7c2f6130d5 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-non-empty-initializer.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-non-empty-initializer.js.snap @@ -126,7 +126,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-objectexpression-phi.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-objectexpression-phi.js.snap index d03e49ed46..3f357318d6 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-objectexpression-phi.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-objectexpression-phi.js.snap @@ -57,7 +57,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -95,7 +95,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -132,7 +132,7 @@ Output: "operator": ">", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -165,7 +165,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -212,7 +212,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-objectexpression.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-objectexpression.js.snap index 6a41d7ee84..fdc9ead513 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-objectexpression.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-objectexpression.js.snap @@ -61,7 +61,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -99,7 +99,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-reassign-in-rval.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-reassign-in-rval.js.snap index 288aac17a6..0fc140c7b3 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-reassign-in-rval.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-reassign-in-rval.js.snap @@ -149,7 +149,7 @@ Output: }, { "type": "NumericLiteral", - "value": 4617315517961601024, + "value": 5.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-reassign.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-reassign.js.snap index 9442db746a..25a6da5af7 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-reassign.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-reassign.js.snap @@ -82,7 +82,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-return.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-return.js.snap index 5658820df5..3600845dcb 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-return.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-return.js.snap @@ -52,7 +52,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -89,7 +89,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -122,7 +122,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-sibling-phis.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-sibling-phis.js.snap index 94d8c4888c..c5ac372c9c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-sibling-phis.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-sibling-phis.js.snap @@ -104,7 +104,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-simple-phi.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-simple-phi.js.snap index 3b0b8b498c..621856a88c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-simple-phi.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-simple-phi.js.snap @@ -55,7 +55,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -92,7 +92,7 @@ Output: "operator": ">", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -125,7 +125,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -172,7 +172,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-simple.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-simple.js.snap index 60ebd9ae42..fb4311ca2d 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-simple.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-simple.js.snap @@ -48,7 +48,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -86,7 +86,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-single-if.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-single-if.js.snap index 9a28f7424b..d4f621331c 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-single-if.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-single-if.js.snap @@ -52,7 +52,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -90,7 +90,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-switch.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-switch.js.snap index 039ca4be86..e4748c56a3 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-switch.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-switch.js.snap @@ -63,7 +63,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -100,7 +100,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -141,7 +141,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -194,7 +194,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -235,7 +235,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -321,7 +321,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-throw.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-throw.js.snap index fa858fbbe3..b21c4a89b0 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-throw.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-throw.js.snap @@ -51,7 +51,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -88,7 +88,7 @@ Output: "operator": "===", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -121,7 +121,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-while-no-reassign.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-while-no-reassign.js.snap index 1121240bc3..b95cc99f50 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-while-no-reassign.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-while-no-reassign.js.snap @@ -52,7 +52,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -89,7 +89,7 @@ Output: "operator": "<", "right": { "type": "NumericLiteral", - "value": 4621819117588971520, + "value": 10.0, "loc": null, "range": { "start": 0, @@ -122,7 +122,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-while.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-while.js.snap index b61e217987..e268719535 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-while.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ssa-while.js.snap @@ -52,7 +52,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -89,7 +89,7 @@ Output: "operator": "<", "right": { "type": "NumericLiteral", - "value": 4621819117588971520, + "value": 10.0, "loc": null, "range": { "start": 0, @@ -135,7 +135,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@switch-non-final-default.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@switch-non-final-default.js.snap index af54d942b1..aa8d93fc3a 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@switch-non-final-default.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@switch-non-final-default.js.snap @@ -164,7 +164,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@switch-with-fallthrough.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@switch-with-fallthrough.js.snap index 1526093478..9c81aa02f9 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@switch-with-fallthrough.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@switch-with-fallthrough.js.snap @@ -111,7 +111,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -139,7 +139,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -177,7 +177,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -205,7 +205,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -243,7 +243,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -281,7 +281,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -309,7 +309,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4613937818241073152, + "value": 3.0, "loc": null, "range": { "start": 0, @@ -356,7 +356,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4616189618054758400, + "value": 4.0, "loc": null, "range": { "start": 0, @@ -384,7 +384,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4616189618054758400, + "value": 4.0, "loc": null, "range": { "start": 0, @@ -422,7 +422,7 @@ Output: "type": "SwitchCase", "test": { "type": "NumericLiteral", - "value": 4617315517961601024, + "value": 5.0, "loc": null, "range": { "start": 0, @@ -450,7 +450,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4617315517961601024, + "value": 5.0, "loc": null, "range": { "start": 0, @@ -508,7 +508,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ternary-assignment-expression.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ternary-assignment-expression.js.snap index 8af32808e2..1c201f6f1f 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ternary-assignment-expression.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@ternary-assignment-expression.js.snap @@ -60,7 +60,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -142,7 +142,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -170,7 +170,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@type-field-load.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@type-field-load.js.snap index d699a7bed7..265b788f25 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@type-field-load.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@type-field-load.js.snap @@ -64,7 +64,7 @@ Output: }, "value": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@type-test-primitive.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@type-test-primitive.js.snap index a38421c334..103dc2ea5d 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@type-test-primitive.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@type-test-primitive.js.snap @@ -50,7 +50,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -88,7 +88,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unconditional-break-label.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unconditional-break-label.js.snap index 033914f70f..c4d5d42b26 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unconditional-break-label.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unconditional-break-label.js.snap @@ -63,7 +63,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -115,7 +115,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unused-conditional.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unused-conditional.js.snap index 0730497fe4..846c7f2e9a 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unused-conditional.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unused-conditional.js.snap @@ -60,7 +60,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -100,7 +100,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, @@ -128,7 +128,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unused-logical.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unused-logical.js.snap index bd46f89ee7..f1b29f399e 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unused-logical.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@unused-logical.js.snap @@ -60,7 +60,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -128,7 +128,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, @@ -156,7 +156,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@use-callback-simple.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@use-callback-simple.js.snap index 5889bcb88d..02d20764ff 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@use-callback-simple.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@use-callback-simple.js.snap @@ -83,7 +83,7 @@ Output: "arguments": [ { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -171,7 +171,7 @@ Output: "operator": "+", "right": { "type": "NumericLiteral", - "value": 4607182418800017408, + "value": 1.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@while-logical.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@while-logical.js.snap index fa8f0680d5..a4428b35eb 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@while-logical.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@while-logical.js.snap @@ -62,7 +62,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, @@ -209,7 +209,7 @@ Output: }, "right": { "type": "NumericLiteral", - "value": 4611686018427387904, + "value": 2.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@while-property.js.snap b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@while-property.js.snap index a324fac624..35b66c940f 100644 --- a/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@while-property.js.snap +++ b/compiler/forget/crates/forget_hermes_parser/tests/snapshots/parser_test__fixtures@while-property.js.snap @@ -72,7 +72,7 @@ Output: }, "init": { "type": "NumericLiteral", - "value": 0, + "value": 0.0, "loc": null, "range": { "start": 0, diff --git a/compiler/forget/crates/forget_hir/src/instruction.rs b/compiler/forget/crates/forget_hir/src/instruction.rs index c24d5fea92..7f1a7d9123 100644 --- a/compiler/forget/crates/forget_hir/src/instruction.rs +++ b/compiler/forget/crates/forget_hir/src/instruction.rs @@ -2,7 +2,7 @@ use std::cell::RefCell; use std::fmt::Display; use std::rc::Rc; -use forget_estree::BinaryOperator; +use forget_estree::{BinaryOperator, JsValue}; use crate::{Function, IdentifierId, InstrIx, InstructionId, ScopeId, Type}; @@ -219,153 +219,7 @@ pub struct FunctionExpression { #[derive(Debug, Clone, PartialEq, Eq)] pub struct Primitive { - pub value: PrimitiveValue, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum PrimitiveValue { - Boolean(bool), - Null, - Number(Number), - String(String), - Undefined, -} - -impl PrimitiveValue { - pub fn is_truthy(&self) -> bool { - match &self { - PrimitiveValue::Boolean(value) => *value, - PrimitiveValue::Number(value) => value.is_truthy(), - PrimitiveValue::String(value) => value.len() != 0, - PrimitiveValue::Null => false, - PrimitiveValue::Undefined => false, - } - } - - // Partial implementation of loose equality for javascript, returns Some for supported - // cases w the equality result, and None for unsupported cases - pub fn loosely_equals(&self, other: &Self) -> Option { - // https://tc39.es/ecma262/multipage/abstract-operations.html#sec-islooselyequal - match (&self, &other) { - // 1. If Type(x) is Type(y), then - // a. Return IsStrictlyEqual(x, y). - (PrimitiveValue::Number(left), PrimitiveValue::Number(right)) => { - Some(left.equals(*right)) - } - (PrimitiveValue::Null, PrimitiveValue::Null) => Some(true), - (PrimitiveValue::Undefined, PrimitiveValue::Undefined) => Some(true), - (PrimitiveValue::Boolean(left), PrimitiveValue::Boolean(right)) => Some(left == right), - (PrimitiveValue::String(left), PrimitiveValue::String(right)) => Some(left == right), - - // 2. If x is null and y is undefined, return true. - (PrimitiveValue::Null, PrimitiveValue::Undefined) => Some(true), - - // 3. If x is undefined and y is null, return true. - (PrimitiveValue::Undefined, PrimitiveValue::Null) => Some(true), - _ => None, - } - } - - pub fn not_loosely_equals(&self, other: &Self) -> Option { - self.loosely_equals(other).map(|value| !value) - } - - // Complete implementation of strict equality for javascript - pub fn strictly_equals(&self, other: &Self) -> bool { - // https://tc39.es/ecma262/multipage/abstract-operations.html#sec-isstrictlyequal - match (&self, &other) { - (PrimitiveValue::Number(left), PrimitiveValue::Number(right)) => left.equals(*right), - (PrimitiveValue::Null, PrimitiveValue::Null) => true, - (PrimitiveValue::Undefined, PrimitiveValue::Undefined) => true, - (PrimitiveValue::Boolean(left), PrimitiveValue::Boolean(right)) => left == right, - (PrimitiveValue::String(left), PrimitiveValue::String(right)) => left == right, - _ => false, - } - } - - pub fn not_strictly_equals(&self, other: &Self) -> bool { - !self.strictly_equals(other) - } -} - -/// Represents a JavaScript Number as its binary representation so that -/// -1 == -1, NaN == Nan etc. -/// Note: NaN is *always* represented as the f64::NAN constant to allow -/// comparison of NaNs. -#[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Debug, Hash)] -pub struct Number(u64); - -impl From for Number { - fn from(value: f64) -> Self { - if value.is_nan() { - Self(f64::NAN.to_bits()) - } else { - Self(value.to_bits()) - } - } -} - -impl From for f64 { - fn from(number: Number) -> Self { - let value = f64::from_bits(number.0); - assert!(!f64::is_nan(value) || number.0 == f64::NAN.to_bits()); - value - } -} - -impl Number { - pub fn equals(self, other: Self) -> bool { - f64::from(self) == f64::from(other) - } - - pub fn not_equals(self, other: Self) -> bool { - !self.equals(other) - } - - pub fn is_truthy(self) -> bool { - let value = f64::from(self); - if self.0 == f64::NAN.to_bits() || value == 0.0 || value == -0.0 { - false - } else { - true - } - } -} - -impl std::ops::Add for Number { - type Output = Number; - - fn add(self, rhs: Self) -> Self::Output { - let result = f64::from(self) + f64::from(rhs); - Self::from(result) - } -} - -impl std::ops::Sub for Number { - type Output = Number; - - fn sub(self, rhs: Self) -> Self::Output { - let result = f64::from(self) - f64::from(rhs); - Self::from(result) - } -} - -impl std::ops::Mul for Number { - type Output = Number; - - fn mul(self, rhs: Self) -> Self::Output { - let result = f64::from(self) * f64::from(rhs); - Self::from(result) - } -} - -impl std::ops::Div for Number { - type Output = Number; - - fn div(self, rhs: Self) -> Self::Output { - let result = f64::from(self) / f64::from(rhs); - Self::from(result) - } + pub value: JsValue, } #[derive(Debug)] diff --git a/compiler/forget/crates/forget_hir/src/print.rs b/compiler/forget/crates/forget_hir/src/print.rs index 9e3c8bc706..521cf44c92 100644 --- a/compiler/forget/crates/forget_hir/src/print.rs +++ b/compiler/forget/crates/forget_hir/src/print.rs @@ -1,10 +1,11 @@ use std::fmt::{Result, Write}; +use forget_estree::JsValue; use forget_utils::ensure_sufficient_stack; use crate::{ BasicBlock, Function, Identifier, IdentifierOperand, Instruction, InstructionValue, LValue, - Operand, Phi, PlaceOrSpread, PrimitiveValue, Terminal, TerminalValue, HIR, + Operand, Phi, PlaceOrSpread, Terminal, TerminalValue, HIR, }; /// Trait for HIR types to describe how they print themselves. @@ -149,14 +150,14 @@ impl Print for InstructionValue { // Unlike other variants we don't print the variant name ("Primitive") since it's // obvious match &value.value { - PrimitiveValue::Boolean(value) => write!(out, "{}", value)?, - PrimitiveValue::Null => write!(out, "null")?, - PrimitiveValue::Number(value) => write!(out, "{}", f64::from(*value))?, + JsValue::Boolean(value) => write!(out, "{}", value)?, + JsValue::Null => write!(out, "null")?, + JsValue::Number(value) => write!(out, "{}", f64::from(*value))?, // TODO: quote the string itself (JS version uses JSON.stringify()) - PrimitiveValue::String(value) => write!(out, "\"{}\"", value.as_str())?, + JsValue::String(value) => write!(out, "\"{}\"", value.as_str())?, - PrimitiveValue::Undefined => write!(out, "")?, + JsValue::Undefined => write!(out, "")?, }; } InstructionValue::StoreLocal(value) => { diff --git a/compiler/forget/crates/forget_optimization/src/constant_propagation.rs b/compiler/forget/crates/forget_optimization/src/constant_propagation.rs index 6c8bd61c6e..8f4ced6f5c 100644 --- a/compiler/forget/crates/forget_optimization/src/constant_propagation.rs +++ b/compiler/forget/crates/forget_optimization/src/constant_propagation.rs @@ -1,11 +1,11 @@ use std::collections::HashMap; use forget_diagnostics::Diagnostic; -use forget_estree::BinaryOperator; +use forget_estree::{BinaryOperator, JsValue}; use forget_hir::{ initialize_hir, merge_consecutive_blocks, BlockKind, Environment, Function, GotoKind, GotoTerminal, IdentifierId, Instruction, InstructionValue, LoadGlobal, Operand, Primitive, - PrimitiveValue, TerminalValue, + TerminalValue, }; use forget_ssa::eliminate_redundant_phis; @@ -208,57 +208,57 @@ fn apply_binary_operator( right: Primitive, ) -> Option { match (left.value, right.value) { - (PrimitiveValue::Number(left), PrimitiveValue::Number(right)) => match operator { + (JsValue::Number(left), JsValue::Number(right)) => match operator { BinaryOperator::Add => Some(Primitive { - value: PrimitiveValue::Number(left + right), + value: JsValue::Number(left + right), }), BinaryOperator::Subtract => Some(Primitive { - value: PrimitiveValue::Number(left - right), + value: JsValue::Number(left - right), }), BinaryOperator::Multiply => Some(Primitive { - value: PrimitiveValue::Number(left * right), + value: JsValue::Number(left * right), }), BinaryOperator::Divide => Some(Primitive { - value: PrimitiveValue::Number(left / right), + value: JsValue::Number(left / right), }), BinaryOperator::LessThan => Some(Primitive { - value: PrimitiveValue::Boolean(left < right), + value: JsValue::Boolean(left < right), }), BinaryOperator::LessThanOrEqual => Some(Primitive { - value: PrimitiveValue::Boolean(left <= right), + value: JsValue::Boolean(left <= right), }), BinaryOperator::GreaterThan => Some(Primitive { - value: PrimitiveValue::Boolean(left > right), + value: JsValue::Boolean(left > right), }), BinaryOperator::GreaterThanOrEqual => Some(Primitive { - value: PrimitiveValue::Boolean(left >= right), + value: JsValue::Boolean(left >= right), }), BinaryOperator::Equals => Some(Primitive { - value: PrimitiveValue::Boolean(left.equals(right)), + value: JsValue::Boolean(left.equals(right)), }), BinaryOperator::NotEquals => Some(Primitive { - value: PrimitiveValue::Boolean(left.not_equals(right)), + value: JsValue::Boolean(left.not_equals(right)), }), BinaryOperator::StrictEquals => Some(Primitive { - value: PrimitiveValue::Boolean(left.equals(right)), + value: JsValue::Boolean(left.equals(right)), }), BinaryOperator::NotStrictEquals => Some(Primitive { - value: PrimitiveValue::Boolean(left.not_equals(right)), + value: JsValue::Boolean(left.not_equals(right)), }), _ => None, }, (left, right) => match operator { BinaryOperator::Equals => left.loosely_equals(&right).map(|value| Primitive { - value: PrimitiveValue::Boolean(value), + value: JsValue::Boolean(value), }), BinaryOperator::NotEquals => left.not_loosely_equals(&right).map(|value| Primitive { - value: PrimitiveValue::Boolean(value), + value: JsValue::Boolean(value), }), BinaryOperator::StrictEquals => Some(Primitive { - value: PrimitiveValue::Boolean(left.strictly_equals(&right)), + value: JsValue::Boolean(left.strictly_equals(&right)), }), BinaryOperator::NotStrictEquals => Some(Primitive { - value: PrimitiveValue::Boolean(left.not_strictly_equals(&right)), + value: JsValue::Boolean(left.not_strictly_equals(&right)), }), _ => None, },