packages feed

hjs-0.1: testsuite/parsingonly/40_functions.js


// constructor -- expression array initialization
function ExprArray(n,v)
{
    // Initializes n values to v coerced to a string.
    for (var i = 0; i < n; i++) {
	this[i] = "" + v;
    }
}

function Hello()
{
	ExprArray(1,1);
}

Reference.prototype.toString = function () { return this.node.getSource(); }

function getValue(v) {
    if (v instanceof Reference) {
        if (!v.base) {
            throw new ReferenceError(v.propertyName + " is not defined",
                                     v.node.filename, v.node.lineno);
        }
        return v.base[v.propertyName];
    }
    return v;
}