There's a few corner cases in which this optimization may change the
meaning of code:

1.  Name scoping of builtins using locals/builtins:

var Array = function() { this.toString = function() { return "bleh"; }
};
x = new Array()
alert(x);

var x = { Array: function() { this.toString = function() { return
"bleh"; } } };
with (x) {
    y = new Array();
}
alert(y);

2. Parameters to constructor:

new Object(1) - "wraps" the object in the parameter so that it has a
different identity.  This shouldn't be modified.

new Array(1,2,3) - wraps the parameters in a new array.  This is always
equivalent to [1,2,3] (with the exception of cases that fall under 1
above).


http://gwt-code-reviews.appspot.com/47810

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to