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

Configure Feed

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

use name of var and not of constructor for singleton values in JS

This fixes bug with wrong name of constructors when that constructor has import alias

+5 -4
+2 -1
compiler-core/src/javascript/expression.rs
··· 1866 1866 ) -> Option<Document<'a>> { 1867 1867 match right { 1868 1868 TypedExpr::Var { 1869 + name, 1869 1870 constructor: 1870 1871 ValueConstructor { 1871 - variant: ValueConstructorVariant::Record { arity: 0, name, .. }, 1872 + variant: ValueConstructorVariant::Record { arity: 0, .. }, 1872 1873 .. 1873 1874 }, 1874 1875 ..
+1 -1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__variant_defined_in_another_module_aliased_expression.snap
··· 20 20 import { Variant as Aliased } from "../other_module.mjs"; 21 21 22 22 export function check(x) { 23 - return x instanceof Variant; 23 + return x instanceof Aliased; 24 24 }
+1 -1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_type_with_import_alias.snap
··· 25 25 import { Active as WibbleActive } from "../wibble.mjs"; 26 26 27 27 export function is_wibble_active(s) { 28 - return s instanceof Active; 28 + return s instanceof WibbleActive; 29 29 }
+1 -1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_type_with_import_alias_and_same_named_local_type.snap
··· 43 43 export const WobbleStatus$isDisabled = (value) => value instanceof Disabled; 44 44 45 45 export function is_wibble_active(s) { 46 - return s instanceof Active; 46 + return s instanceof WibbleActive; 47 47 } 48 48 49 49 export function is_wobble_active(s) {