From e874e6e13375515f67c0d655979b483d34acdadd Mon Sep 17 00:00:00 2001 From: X3ZvaWQ Date: Fri, 16 Feb 2024 01:40:21 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20pointer=E7=8E=B0=E5=9C=A8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8number=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 4 ++-- package.json | 2 +- src/thread.ts | 7 +++---- src/utils/pointer.ts | 5 ----- 4 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 src/utils/pointer.ts diff --git a/package-lock.json b/package-lock.json index fdca07c..b515ea7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wasmoon-lua5.1", - "version": "1.18.7", + "version": "1.18.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wasmoon-lua5.1", - "version": "1.18.7", + "version": "1.18.8", "license": "MIT", "dependencies": { "@types/emscripten": "^1.39.10", diff --git a/package.json b/package.json index 47a97ab..79006df 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wasmoon-lua5.1", - "version": "1.18.7", + "version": "1.18.8", "description": "A real lua 5.1 VM with JS bindings made with webassembly", "main": "dist/index.js", "scripts": { diff --git a/src/thread.ts b/src/thread.ts index 0180bd4..1f404fa 100755 --- a/src/thread.ts +++ b/src/thread.ts @@ -4,7 +4,6 @@ import { LUA_MULTRET, LUA_REGISTRYINDEX, LuaEventMasks, LuaReturn, LuaType, Poin import { LuaDebug } from './lua-debug'; import { getTable } from './table'; import MultiReturn from './multireturn'; -import Pointer from './utils/pointer'; import type LuaApi from './api'; // When the debug count hook is set, call it every X instructions. @@ -463,15 +462,15 @@ export default class LuaThread { } //============调试用 - public getGlobalPointer(name: string): Pointer { + public getGlobalPointer(name: string): number { this.luaApi.lua_getglobal(this.address, name); const pointer = this.getPointer(-1); this.pop(); return pointer; } - public getPointer(index: number): Pointer { - return new Pointer(this.luaApi.lua_topointer(this.address, index)); + public getPointer(index: number): number { + return this.luaApi.lua_topointer(this.address, index); } public indexToString(index: number): string { diff --git a/src/utils/pointer.ts b/src/utils/pointer.ts deleted file mode 100644 index c099323..0000000 --- a/src/utils/pointer.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default class Pointer extends Number { - toString(): string { - return `0x${super.toString(16)}`; - } -}