#144 new
Diego Perini

Envjs.sync errors when using "document.close()" after "document.write()"

Reported by Diego Perini | March 31st, 2010 @ 03:13 AM

I am not sure how this should be fixed and need somebody looking after it.

Currently in "env.js" we have:

Envjs.sync = function(fn){};

and later on in the code the above is used like this:

$timers.lock = function(fn){
    Envjs.sync(fn)();
};

the error I get says:

../env/dist/env.js:4686: TypeError: undefined is not a function Envjs.sync(fn)();

so I believe the Envjs.sync function should be declared like this (returning the passed function):

Envjs.sync = function(fn){return fn;};

Not having enough knowledge of the complete code, as said above, I need a confirmation the above is the correct way to fix this.

It doesn't errors anymore in my tests, but that doesn't mean it is correct.

Thank you in advance for looking at it.

Comments and changes to this ticket

  • nickg

    nickg March 31st, 2010 @ 04:42 PM

    hi there,

    Envjs.sync = function(fn){return fn;};
    

    is correct, BUT....

    envjs isn't really setup to support other js engines. I say this cause I'm working on fixing that, but in the mean time, I just committed some work in progress that may help. do a git pull and look at 'platform-common.js'

    what platform are you using? and, for my own curiosity, why?

    good luck!

    --nickg

  • nickg

    nickg April 1st, 2010 @ 02:42 AM

    Thanks, that's very useful.

    The big gotcha is Envjs.connection. It needs some work to make it be a really good api. But looking at the rhino version you might be to see how to hack a file-only version. I'm working on fixing this up now, but hard to say. Let us know you experience with nodejs.org! My guess is that a gpsee & flusspferd version will be done shortly.

    (sidenote: sounds like an interesting project! I seem to remember another company where you could type in or even visually select stuff to scape and they would provide an RSS feed of it. My guess is that it was static and didn't run JS.)

    GOod luck! and keep filing tickets!

    --nickg

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