Hi all,
I just started using the MIPS port of V8. So far I'm using the 'shell'
program to run JS code. Everything works fine unless the '--debug-
code' switch is enabled. With the switch, an "unexpected declaration
in current context" error error pops out (the full message text is
below).
A brief evaluation revealed that it only happens when a nested JS
function accesses a variable that is defined in the enclosing function
body. For instance, when the nested function SetupArray.getFunction()
accesses the SetupArray.specialFunctions variable, in src/array.js.
I do realize that the MIPS port is out of the official scope, but the
full-codegen part (which pops out the error) is very similar in all V8
ports. So could someone point out what the reason could be? What
should be checked fist?
Thanks.
--
And here goes the full error message text:
abort: Unexpected declaration in current context.
==== Stack trace ============================================
Security context: 0x2caa8991 <JS Object>#0#
1: SetupArray [native array.js:1180] (this=0x2caa9391 <JS
Object>#1#)
2: /* anonymous */ [native array.js:1249] (this=0x2caa9391 <JS
Object>#1#)
==== Details ================================================
[1]: SetupArray [native array.js:1180] (this=0x2caa9391 <JS
Object>#1#) {
// stack-allocated locals
var getFunction = 0x2cae8061 <undefined>
// heap-allocated locals
var a = 0x2cae8061 <undefined>
// expression stack (top to bottom)
[03] : 0
[02] : 0
[01] : 3301874
--------- s o u r c e c o d e ---------
function SetupArray(){???%SetProperty($Array.prototype,"constructor",
$Array,2);???InstallFunctions($Array,
2,$Array(?"isArray",ArrayIsArray?));??var a=
%SpecialArrayFunctions({});??function getFunction(b,c,d){?var g=c;?
if(a.hasOwnProperty(b)){?g=a[b];?}?if(!(typeof(d)==='undefined')){?
%FunctionSetLength(g,d);?}?return g...
-----------------------------------------
}
[2]: /* anonymous */ [native array.js:1249] (this=0x2caa9391 <JS
Object>#1#) {
// stack-allocated locals
var .result = 0x2cae8061 <undefined>
// expression stack (top to bottom)
[01] : 0x2caa9391 <JS Object>#1#
--------- s o u r c e c o d e ---------
???????????????????????????????????var visited_arrays=new
InternalArray();?????function GetSortedArrayKeys(a,b){?var c=b.length;?
var d=[];?for(var e=0;e<c;e++){?var f=b[e];?if(f<0){?var g=-1-f;?var
h=g+b[++e];?for(;g<h;g++){?var i=a[g];?if(!(typeof(i)==='undefined')||
g in a){?d.push(g);?}?}?}else{??...
-----------------------------------------
}
==== Key ============================================
#0# 0x2caa8991: 0x2caa8991 <JS Object>
#1# 0x2caa9391: 0x2caa9391 <JS Object>
=====================
Aborted
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users