projects
/
org.ibex.js.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
afd68d3
)
fix JSArgs bugs
author
adam
<adam@megacz.com>
Mon, 17 Jan 2005 00:27:46 +0000
(
00:27
+0000)
committer
adam
<adam@megacz.com>
Mon, 17 Jan 2005 00:27:46 +0000
(
00:27
+0000)
darcs-hash:
20050117002746
-5007d-
a935a54efd40e7399a045ec624fb7a1fd944d4ce
.gz
src/org/ibex/js/Interpreter.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/js/Interpreter.java
b/src/org/ibex/js/Interpreter.java
index
77da0ab
..
21fffba
100644
(file)
--- a/
src/org/ibex/js/Interpreter.java
+++ b/
src/org/ibex/js/Interpreter.java
@@
-371,8
+371,8
@@
class Interpreter implements ByteCodes, Tokens, Pausable {
if (object instanceof JSFunction) {
stack.push(new CallMarker(this));
if (object instanceof JSFunction) {
stack.push(new CallMarker(this));
- stack.push(jsargs);
f = (JSFunction)object;
f = (JSFunction)object;
+ stack.push(new JSArgs(jsargs, f));
scope = f.parentScope;
pc = -1;
break;
scope = f.parentScope;
pc = -1;
break;
@@
-610,7
+610,10
@@
class Interpreter implements ByteCodes, Tokens, Pausable {
public JSArgs(JS[] args, JS callee) { this.args = args; this.callee = callee; }
public JS get(JS key) throws JSExn {
public JSArgs(JS[] args, JS callee) { this.args = args; this.callee = callee; }
public JS get(JS key) throws JSExn {
- if(JSU.isInt(key)) return args[JSU.toInt(key)];
+ if(JSU.isInt(key)) {
+ int i = JSU.toInt(key);
+ return i>=args.length ? null : args[i];
+ }
//#switch(JSU.toString(key))
case "callee": return callee;
case "length": return JSU.N(args.length);
//#switch(JSU.toString(key))
case "callee": return callee;
case "length": return JSU.N(args.length);