Skip to content

Commit

Permalink
builtins/internal_object: do not use fastIndexOf
Browse files Browse the repository at this point in the history
weird memory corruption fun, disable for now
  • Loading branch information
CanadaHonk committed Aug 30, 2024
1 parent 6395b7d commit db8f7ca
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion compiler/builtins/__internal_object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export const __Porffor_object_underlying = (obj: any): any => {
}

if (Porffor.fastAnd(t > 0x05, t != Porffor.TYPES.undefined)) {
let idx: i32 = Porffor.array.fastIndexOf(underlyingKeys, obj);
// this causes memory corruption things in some situations in test262?
// let idx: i32 = Porffor.array.fastIndexOf(underlyingKeys, obj);

let idx: i32 = underlyingKeys.indexOf(obj);
if (idx == -1) {
const underlying: object = {};

Expand Down
5 changes: 2 additions & 3 deletions compiler/builtins_precompiled.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "porffor",
"description": "a basic experimental wip aot optimizing js -> wasm engine/compiler/runtime in js",
"version": "0.41.1+1afa668c0",
"version": "0.41.2+5b89877a2",
"author": "CanadaHonk",
"license": "MIT",
"scripts": {},
Expand Down
2 changes: 1 addition & 1 deletion runner/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import fs from 'node:fs';
globalThis.version = '0.41.1+1afa668c0';
globalThis.version = '0.41.2+5b89877a2';

// deno compat
if (typeof process === 'undefined' && typeof Deno !== 'undefined') {
Expand Down

0 comments on commit db8f7ca

Please sign in to comment.