From e326847287e7bfb409a344e8adfa74f9563d146a Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Sun, 5 Nov 2023 19:44:35 +0200 Subject: [PATCH] feat: send value stack to debug client --- .../jscript/engine/debug/SimpleDebugger.java | 6 ++++-- .../jscript/engine/frame/CodeFrame.java | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/me/topchetoeu/jscript/engine/debug/SimpleDebugger.java b/src/me/topchetoeu/jscript/engine/debug/SimpleDebugger.java index 32a5984..bc6d632 100644 --- a/src/me/topchetoeu/jscript/engine/debug/SimpleDebugger.java +++ b/src/me/topchetoeu/jscript/engine/debug/SimpleDebugger.java @@ -40,7 +40,7 @@ public class SimpleDebugger implements Debugger { public static final String VSCODE_SHALLOW_COPY = "function(){let t={__proto__:this.__proto__\n},e=Object.getOwnPropertyNames(this);for(let r=0;r>>0;if(String(n>>>0)===i&&n>>>0!==4294967295)continue;let s=Object.getOwnPropertyDescriptor(this,i);s&&Object.defineProperty(t,i,s)}return t}"; public static final String VSCODE_FLATTEN_ARRAY = "function(t,e){let r={\n},i=t===-1?0:t,n=e===-1?this.length:t+e;for(let s=i;s= stackPtr) return null; + else return stack[i]; + } + @Override + protected boolean hasField(Context ctx, Object key) { + return true; + } + @Override + public List keys(boolean includeNonEnumerable) { + var res = super.keys(includeNonEnumerable); + for (var i = 0; i < stackPtr; i++) res.add(i); + return res; + } + }; + } public void addTry(int n, int catchN, int finallyN) { var res = new TryCtx(codePtr + 1, n, catchN, finallyN);