Write some tests #33

Merged
topchetoeu merged 13 commits from topchetoeu/tests into master 2025-01-15 18:23:25 +00:00
5 changed files with 9 additions and 9 deletions
Showing only changes of commit 3b512b64eb - Show all commits

View File

@ -26,6 +26,10 @@ import me.topchetoeu.j2s.compilation.JavaScript;
import me.topchetoeu.j2s.compilation.json.JSON; import me.topchetoeu.j2s.compilation.json.JSON;
import me.topchetoeu.j2s.compilation.parsing.Parsing; import me.topchetoeu.j2s.compilation.parsing.Parsing;
import me.topchetoeu.j2s.compilation.parsing.Source; import me.topchetoeu.j2s.compilation.parsing.Source;
import me.topchetoeu.j2s.repl.buffers.Int32ArrayValue;
import me.topchetoeu.j2s.repl.buffers.Int8ArrayValue;
import me.topchetoeu.j2s.repl.buffers.TypedArrayValue;
import me.topchetoeu.j2s.repl.buffers.Uint8ArrayValue;
import me.topchetoeu.j2s.repl.debug.DebugServer; import me.topchetoeu.j2s.repl.debug.DebugServer;
import me.topchetoeu.j2s.repl.debug.Debugger; import me.topchetoeu.j2s.repl.debug.Debugger;
import me.topchetoeu.j2s.repl.debug.SimpleDebugger; import me.topchetoeu.j2s.repl.debug.SimpleDebugger;
@ -44,10 +48,6 @@ import me.topchetoeu.j2s.runtime.values.functions.NativeFunction;
import me.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue; import me.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue;
import me.topchetoeu.j2s.runtime.values.objects.ArrayValue; import me.topchetoeu.j2s.runtime.values.objects.ArrayValue;
import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; import me.topchetoeu.j2s.runtime.values.objects.ObjectValue;
import me.topchetoeu.j2s.runtime.values.objects.buffers.Int32ArrayValue;
import me.topchetoeu.j2s.runtime.values.objects.buffers.Int8ArrayValue;
import me.topchetoeu.j2s.runtime.values.objects.buffers.TypedArrayValue;
import me.topchetoeu.j2s.runtime.values.objects.buffers.Uint8ArrayValue;
import me.topchetoeu.j2s.runtime.values.primitives.BoolValue; import me.topchetoeu.j2s.runtime.values.primitives.BoolValue;
import me.topchetoeu.j2s.runtime.values.primitives.StringValue; import me.topchetoeu.j2s.runtime.values.primitives.StringValue;
import me.topchetoeu.j2s.runtime.values.primitives.SymbolValue; import me.topchetoeu.j2s.runtime.values.primitives.SymbolValue;
@ -701,7 +701,7 @@ public class SimpleRepl {
res.defineOwnField(env, "invoke", new NativeFunction(args -> { res.defineOwnField(env, "invoke", new NativeFunction(args -> {
var func = (FunctionValue)args.get(0); var func = (FunctionValue)args.get(0);
var self = args.get(1); var self = args.get(1);
var funcArgs = (ArrayValue)args.get(2); var funcArgs = (ArrayLikeValue)args.get(2);
return func.apply(env, self, funcArgs.toArray()); return func.apply(env, self, funcArgs.toArray());
})); }));

View File

@ -1,4 +1,4 @@
package me.topchetoeu.j2s.runtime.values.objects.buffers; package me.topchetoeu.j2s.repl.buffers;
public final class Int32ArrayValue extends TypedArrayValue { public final class Int32ArrayValue extends TypedArrayValue {
@Override protected int onGet(int i) { @Override protected int onGet(int i) {

View File

@ -1,4 +1,4 @@
package me.topchetoeu.j2s.runtime.values.objects.buffers; package me.topchetoeu.j2s.repl.buffers;
public final class Int8ArrayValue extends TypedArrayValue { public final class Int8ArrayValue extends TypedArrayValue {
@Override protected int onGet(int i) { @Override protected int onGet(int i) {

View File

@ -1,4 +1,4 @@
package me.topchetoeu.j2s.runtime.values.objects.buffers; package me.topchetoeu.j2s.repl.buffers;
import java.util.WeakHashMap; import java.util.WeakHashMap;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.j2s.runtime.values.objects.buffers; package me.topchetoeu.j2s.repl.buffers;
public final class Uint8ArrayValue extends TypedArrayValue { public final class Uint8ArrayValue extends TypedArrayValue {
@Override protected int onGet(int i) { @Override protected int onGet(int i) {