porffor 0.60.8 → 0.60.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/foo.js ADDED
@@ -0,0 +1,34 @@
1
+ // benchmark.js
2
+ const ITER = 50_000_000; // 50 million iterations
3
+ const key = "a";
4
+
5
+ // Create a null-prototype object
6
+ const o = Object.create(null);
7
+ o[key] = 123;
8
+
9
+ // --- Benchmark "in" ---
10
+ const t1 = Date.now();
11
+ for (let i = 0; i < ITER; i++) {
12
+ if (key in o) {
13
+ // noop
14
+ }
15
+ }
16
+ console.log(`in: ${Date.now() - t1}ms`);
17
+
18
+ // --- Benchmark Object.hasOwn ---
19
+ const t2 = Date.now();
20
+ for (let i = 0; i < ITER; i++) {
21
+ if (Object.hasOwn(o, key)) {
22
+ // noop
23
+ }
24
+ }
25
+ console.log(`Object.hasOwn: ${Date.now() - t2}ms`);
26
+
27
+ // --- Benchmark o[k] ---
28
+ const t3 = Date.now();
29
+ for (let i = 0; i < ITER; i++) {
30
+ if (o[key] !== undefined) {
31
+ // noop
32
+ }
33
+ }
34
+ console.log(`o[k]: ${Date.now() - t3}ms`);
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "porffor",
3
3
  "description": "An ahead-of-time JavaScript compiler",
4
- "version": "0.60.8",
4
+ "version": "0.60.10",
5
5
  "author": "Oliver Medhurst <honk@goose.icu>",
6
6
  "license": "MIT",
7
7
  "scripts": {},
8
8
  "dependencies": {
9
9
  "acorn": "^8.15.0",
10
- "node-repl-polyfill": "github:CanadaHonk/node-repl-polyfill"
10
+ "node-repl-polyfill": "^0.1.2"
11
11
  },
12
12
  "optionalDependencies": {
13
13
  "@babel/parser": "^7.24.4",
package/runtime/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from 'node:fs';
3
- globalThis.version = '0.60.8';
3
+ globalThis.version = '0.60.10';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {