Skip to content

Commit b649d35

Browse files
hadeeblpil
authored andcommitted
Annotate javascript constants as pure
1 parent 367ccaa commit b649d35

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/dict.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
import { isEqual } from "./gleam.mjs";
77

8-
const referenceMap = new WeakMap();
9-
const tempDataView = new DataView(new ArrayBuffer(8));
8+
const referenceMap = /* @__PURE__ */ new WeakMap();
9+
const tempDataView = /* @__PURE__ */ new DataView(
10+
/* @__PURE__ */ new ArrayBuffer(8),
11+
);
1012
let referenceUID = 0;
1113
/**
1214
* hash the object by reference using a weak map and incrementing uid
@@ -988,4 +990,4 @@ export default class Dict {
988990

989991
// This is thrown internally in Dict.equals() so that it returns false as soon
990992
// as a non-matching key is found
991-
const unequalDictSymbol = Symbol();
993+
const unequalDictSymbol = /* @__PURE__ */ Symbol();

src/gleam_stdlib.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,10 @@ const unicode_whitespaces = [
302302
"\u2029", // Paragraph separator
303303
].join("");
304304

305-
const trim_start_regex = new RegExp(`^[${unicode_whitespaces}]*`);
306-
const trim_end_regex = new RegExp(`[${unicode_whitespaces}]*$`);
305+
const trim_start_regex = /* @__PURE__ */ new RegExp(
306+
`^[${unicode_whitespaces}]*`,
307+
);
308+
const trim_end_regex = /* @__PURE__ */ new RegExp(`[${unicode_whitespaces}]*$`);
307309

308310
export function trim_start(string) {
309311
return string.replace(trim_start_regex, "");

0 commit comments

Comments
 (0)