Skip to content

Commit

Permalink
chore: pointer现在使用number表示
Browse files Browse the repository at this point in the history
  • Loading branch information
X3ZvaWQ committed Feb 15, 2024
1 parent 23cef80 commit e874e6e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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,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": {
Expand Down
7 changes: 3 additions & 4 deletions src/thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions src/utils/pointer.ts

This file was deleted.

0 comments on commit e874e6e

Please sign in to comment.