Skip to content

Commit

Permalink
fix build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
justjake committed Aug 31, 2024
1 parent bc31e94 commit 2712af5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 0 additions & 2 deletions c/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,7 @@ JSValue qts_resolve_func_data(
}

MaybeAsync(JSValue *) QTS_Eval(JSContext *ctx, BorrowedHeapChar *js_code, size_t js_code_length, const char *filename, EvalDetectModule detectModule, EvalFlags evalFlags) {
#ifdef QTS_DEBUG_MODE
char msg[LOG_LEN];
#endif
if (detectModule) {
if (JS_DetectModule((const char *)js_code, js_code_length)) {
QTS_DEBUG("QTS_Eval: Detected module = true");
Expand Down
13 changes: 9 additions & 4 deletions packages/quickjs-emscripten-core/src/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,26 @@ import type { QuickJSHandle } from "./types"
/**
* @private
*/
type HeapUint8Array = {
export type HeapUint8Array = {
pointer: JSVoidPointer
numBytes: number
}

// Add more types as needed.
type TypedArray = Int32Array | Uint32Array
/**
* Add more types as needed.
* @private
*/
export type TypedArray = Int32Array | Uint32Array

interface TypedArrayConstructor<T> {
/** @private */
export interface TypedArrayConstructor<T> {
new (length: number): T
new (array: ArrayLike<number> | ArrayBufferLike): T
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): T
BYTES_PER_ELEMENT: number
}

/** @private */
export type HeapTypedArray<JS extends TypedArray, C extends number> = Lifetime<{
typedArray: JS
ptr: C
Expand Down
6 changes: 2 additions & 4 deletions packages/quickjs-emscripten/src/quickjs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ import {
RELEASE_ASYNC,
newVariant,
shouldInterruptAfterDeadline,
Scope,
} from "."
import { Scope } from "quickjs-emscripten-core"

const TEST_SLOW = !process.env.TEST_FAST
const TEST_NG = TEST_SLOW && !process.env.TEST_NO_NG
Expand Down Expand Up @@ -117,7 +117,7 @@ function contextTests(getContext: GetTestContext, isDebug = false) {
}
// https://web.dev/webassembly-memory-debugging/
assert.strictEqual(ffi.QTS_RecoverableLeakCheck(), 0, "No lsan errors")
console.log("Leaks checked (OK)")
debugLog("Leaks checked (OK)")
})

const getTestId = () => `test-${getContext.name}-${testId}`
Expand Down Expand Up @@ -423,8 +423,6 @@ function contextTests(getContext: GetTestContext, isDebug = false) {
.unwrap(),
)

console.log(props.map((p) => vm.dump(p)))

assert.strictEqual(props.length, 3)
assert.strictEqual(vm.dump(props[0]), 0)
assert.strictEqual(vm.dump(props[1]), 1)
Expand Down

0 comments on commit 2712af5

Please sign in to comment.