#84 ✓resolved
Sander Sõnajalg

documentation update

Reported by Sander Sõnajalg | December 16th, 2009 @ 06:33 AM | in 1.2.x

hey,
that one is not a software bug, just a documentation update suggestion ;)

well, i got quite pissed by rhino not eating the configuration syntax suggested by your documentation:

Envjs({
    logLevel: Envjs.DEBUG,
    scriptTypes: {
       'text/javascript': true
    }
});

.. it just doesn't (or is it just me?) well, after typing it to google, i found another syntax (sry, probably that's super-obvious but i'm not a big javascripter traditionally):

Envjs.scriptTypes["text/javascript"] = true;

that one worked right away. your original snippet is probably..õmmmm... some new syntactic sugar from mozilla's new javascript specifications? anyway, it seems to be amiss in my rhino at least (funny.. rhino IS mozilla's. maybe there's another explanation, but anyhow..).

Comments and changes to this ticket

  • Thatcher

    Thatcher February 3rd, 2010 @ 05:24 PM

    • State changed from “new” to “open”
    • Assigned user set to “Thatcher”
    • Milestone set to 1.2.x

    No Envjs is both a Function and an Object and the former, when called ( was meant to extend the internal object Envjs.{} ) did have a bug, or rather a 'disappeared feature'. This is resloved in 1.2 but know I need to clarify that. Envjs is only a one parameter function

    Envjs(options) where options is a {}, simple serves to override values preset internally. This is both Envjs platform and hook interface. We used to support

    Envjs('http://www.google.com', {

    logLevel: Envjs.DEBUG,
    scriptTypes: {
       'text/javascript': true
    }
    

    });

    which was actually meant to be an improvement on

    Envjs({

    logLevel: Envjs.DEBUG,
    scriptTypes: {
       'text/javascript': true
    }
    

    });

    window.location = ...

    But we forgot to still allow that, eg we expect the second arg to be the overriding properties. Now, we are supporting Envjs only as an extension function ie

    Envjs({

    logLevel: Envjs.DEBUG,
    scriptTypes: {
       'text/javascript': true
    }
    

    });

    and there are no instance properties so its basically a static factory pattern.

    I won't close this until I update the actual doc describing the current api for treating Envjs as a function.

    Thatcher

  • Thatcher

    Thatcher February 4th, 2010 @ 05:42 PM

    • State changed from “open” to “resolved”
    • Tag set to envjs location policy deprecated

    ok I updated the refactor to allow the 1.1 methods of simultaneously setting policy for Envjs and setting the window.location.

    Note: we are deprecating this though we will continue to support it for the duration of 1.0, 1.1, and 1.2. At some point Envjs as a function will only support a single arg as an object to set policy.

    Thanks for the ticket!

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