2003/06/16 08:47:28
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:01:19 +0000 (07:01 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:01:19 +0000 (07:01 +0000)
darcs-hash:20040130070119-2ba56-644e0b2be514b1c699e5e2cf64228c83a7f25cbd.gz

src/org/xwt/js/CompiledFunctionImpl.java
src/org/xwt/js/Context.java [deleted file]
src/org/xwt/js/package.html [new file with mode: 0644]

index 0755251..416cd94 100644 (file)
@@ -4,6 +4,7 @@ package org.xwt.js;
 import org.xwt.util.*;
 import java.io.*;
 
+// FIXME: could use some cleaning up
 /** a JavaScript function, compiled into bytecode */
 class CompiledFunctionImpl extends JS.Callable implements ByteCodes, Tokens {
 
@@ -13,10 +14,6 @@ class CompiledFunctionImpl extends JS.Callable implements ByteCodes, Tokens {
     private String sourceName;
     public String getSourceName() throws JS.Exn { return sourceName; }
     
-    /** the first line of this function */
-    private int firstLine;
-    public int getFirstLine() throws JS.Exn { return firstLine; }
-        
     /** the line numbers */
     private int[] line = new int[10];
 
@@ -104,9 +101,11 @@ class CompiledFunctionImpl extends JS.Callable implements ByteCodes, Tokens {
         
     int pc = 0;
     void eval(JS.Scope s) {
-        final Vec t = JS.Thread.fromJavaThread(java.lang.Thread.currentThread()).stack;
+        final JS.Thread cx = JS.Thread.fromJavaThread(java.lang.Thread.currentThread());
+        final Vec t = cx.stack;
         OUTER: for(pc=0; pc<size; pc++) {
             String label = null;
+            cx.line = line[op];
             switch(op[pc]) {
             case LITERAL: t.push(arg[pc]); break;
             case OBJECT: t.push(new JS.Obj()); break;
diff --git a/src/org/xwt/js/Context.java b/src/org/xwt/js/Context.java
deleted file mode 100644 (file)
index 000c0f8..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
-
-import org.xwt.util.*;
-import java.io.*;
-import java.util.*;
-
diff --git a/src/org/xwt/js/package.html b/src/org/xwt/js/package.html
new file mode 100644 (file)
index 0000000..77b3de5
--- /dev/null
@@ -0,0 +1,7 @@
+<body>
+
+<p>
+The XWT JavaScript Engine.  See org.xwt.js.JS for the public face of the API.
+</p>
+
+</body>
\ No newline at end of file