Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

use globalThis.Math.trunc

+6 -6
+1 -1
compiler-core/src/javascript/expression.rs
··· 1452 1452 } else { 1453 1453 docvec![left_doc, " / ", right_doc] 1454 1454 }; 1455 - docvec!["Math.trunc", wrap_args([division])] 1455 + docvec!["globalThis.Math.trunc", wrap_args([division])] 1456 1456 } else { 1457 1457 self.tracker.int_division_used = true; 1458 1458 docvec!["divideInt", wrap_args([left_doc, right_doc])]
+1 -1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__int_division.snap
··· 16 16 import { divideInt } from "../gleam.mjs"; 17 17 18 18 export function main() { 19 - let $ = Math.trunc(5 / 2); 19 + let $ = globalThis.Math.trunc(5 / 2); 20 20 let x = $; 21 21 if (x === (divideInt(5, 2))) { 22 22 return true;
+1 -1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__complex_division_by_non_zero_int.snap
··· 9 9 10 10 ----- COMPILED JAVASCRIPT 11 11 export function main() { 12 - return Math.trunc((1 + 2) / 3); 12 + return globalThis.Math.trunc((1 + 2) / 3); 13 13 }
+1 -1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__division_by_non_zero_int.snap
··· 9 9 10 10 ----- COMPILED JAVASCRIPT 11 11 export function main() { 12 - return Math.trunc(1 / 2); 12 + return globalThis.Math.trunc(1 / 2); 13 13 }
+1 -1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__int_divide_complex_expr.snap
··· 14 14 15 15 ----- COMPILED JAVASCRIPT 16 16 export function go() { 17 - return Math.trunc( 17 + return globalThis.Math.trunc( 18 18 (() => { 19 19 let $ = 1 >= 0; 20 20 if ($) {
+1 -1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__int_operators.snap
··· 21 21 export function go() { 22 22 1 + 1; 23 23 5 - 1; 24 - Math.trunc(5 / 2); 24 + globalThis.Math.trunc(5 / 2); 25 25 3 * 3; 26 26 5 % 2; 27 27 2 > 1;