__defineProperty__ by default in SpiderMonkey

View: New views
3 Messages — Rating Filter:   Alert me  

__defineProperty__ by default in SpiderMonkey

by Olov Johansson :: Rate this Message:

| View Threaded | Show Only this Message

Hi,
is __defineProperty__ expected to be enabled by default (not only inside
#ifdef NARCISSUS) in SpiderMonkey in the future and if so, approximately
when (for what generation of the browsers)? Is this something that is
likely to appear in a minor upgrade of JavaScript (such as 1.7) or not
until JS 2.0?

Thanks,


Olov Johansson
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Re: __defineProperty__ by default in SpiderMonkey

by Brendan Eich :: Rate this Message:

| View Threaded | Show Only this Message

Olov Johansson wrote:
> Hi,
> is __defineProperty__ expected to be enabled by default (not only inside
> #ifdef NARCISSUS) in SpiderMonkey in the future and if so, approximately
> when (for what generation of the browsers)? Is this something that is
> likely to appear in a minor upgrade of JavaScript (such as 1.7) or not
> until JS 2.0?


We have no plans to add this by default, as it exposes security holes
without further access checking, and it violates the integrity of the
built-in objects that use JSPROP_PERMANENT and JSPROP_READONLY.

Why do you want it exposed in the language?  If for Narcissus in the
browser, e.g., could you try to do without it?  The result won't comply
with ECMA-262, but should work ok.

/be
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Re: __defineProperty__ by default in SpiderMonkey

by Olov Johansson :: Rate this Message:

| View Threaded | Show Only this Message

Brendan Eich wrote:

> Why do you want it exposed in the language?  If for Narcissus in the
> browser, e.g., could you try to do without it?  The result won't comply
> with ECMA-262, but should work ok.

That's right, I'm toying with Narcissus. I've just begun working on a
liveprogramming environment where the AST gets transformed by the
programmer in runtime, blending the editor, compiler/interpreter and
debugger into one from the user perspective. I've only looked into
Narcissus for a few days but so far it seems to fit my purpose very well
(with added code for AST modifications in the parser and tracing in the
evaluator). Narcissus tinyness helps me dramatically, compared to
hooking into SpiderMonkey or Rhino (I have no experience in either of
them). It's an elegant piece of code you've written, kudos for that.

My initial idea was to target the browser as a platform for the
liveprogramming environment. Having it running (ECMA-262 compatible) on
a vanilla Firefox would obviously be helpful, but it's not a show-stopper.

For now I just took the short route of removing snarf from global and
hacking
Object.prototype.__defineProperty__ = function(property, value) {
        this[property] = value;
}
which is ok for now. Could it be worked around in Narcissus in a proper
way by writing an own (more explicit) property-mechanism that handles
permanent, readonly and enumerate flags on the higher Narcissus-level? I
do realise that the problems would still exist when code interacts
between Narcissus- and SpiderMonkey-boundaries.


Thanks,

Olov Johansson
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine