#182 new
Jan Jonas

env.rhino.1.2: Calling alert() throws Exception "Cannot find function alert in object"

Reported by Jan Jonas | November 18th, 2010 @ 03:16 AM

I've downloaded the following files:
- http://github.com/thatcher/env-js/zipball/1.2.13 - http://www.envjs.com/dist/env.rhino.1.2.js

I'm confused about the headline "Everything" on the download page
(http://www.envjs.com/release/envjs-1.2) because the env.rhino.1.2.js file seems not to be included in the zip archive.

I extracted the zip archive and copied the file env.rhino.1.2.js to
the created directory. In the extracted directory I executed java -jar
rhino\js.jar -opt -1 to get the javascript console. After loading
env.rhino.1.2 calling alert() throws an exception:

js> load("env.rhino.1.2.js");
[ Envjs/1.6 (Rhino; U; Windows 7 amd64 6.1; en-US; rv:1.7.0.rc2) Resig/20070309
PilotFish/1.2.13 ] js> alert("hello world");
js: "env.rhino.1.2.js", line 13934: uncaught JavaScript runtime
exception: TypeE
rror: Cannot find function alert in object
function () {

var i, name, override = function () {
    for (i = 0; i < arguments.length; i++) {
        for (name in arguments[i]) {
            var g = arguments[i].__lookupGetter__(name), s =

arguments[i].
lookupSetter
(name);

            if (g || s) {
                if (g) {
                    Envjs.__defineGetter__(name, g);
                }
                if (s) {
                    Envjs.__defineSetter__(name, s);
                }
            } else {
                Envjs[name] = arguments[i][name];
            }
        }
    }
};
if (arguments.length === 1 && typeof (arguments[0]) == "string") {
    window.location = arguments[0];
} else {
    if (arguments.length === 1 && typeof (arguments[0]) ==

"object") {

        override(arguments[0]);
    } else {
        if (arguments.length === 2 && typeof (arguments[0]) ==

"string") {

            override(arguments[1]);
            window.location = arguments[0];
        }
    }
}
return;

}

.

    at env.rhino.1.2.js:13934
    at <stdin>:3

As far as I understand the envjs, calling alert should be possible
after loading the env.rhino javascript environment. But maybe I miss
something. Calling Envjs.alert() throws the same exception.

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

a javascript browser environment

People watching this ticket

Pages