[Development] QML, v8 and freezing the global object

aaron.kennedy at nokia.com aaron.kennedy at nokia.com
Fri Oct 12 12:16:26 CEST 2012


Hi,

On 11/10/2012, at 3:04 PM, ext Thomas McGuire wrote:

> the QML engine "freezes" the global JS object. This is apparently(?) to 
> prevent accidental writes to the global object. For those who don't know, the 
> global object in JS provides objects and properties available in global scope, 
> such as "console" (for console.log) or "qsTr".

In addition preventing the common errors that a mutable global object causes (try running common JS libraries and see how many of them accidentally modify the global object because they forgot to put a "var" somewhere), a mutable global object would prevent QML from optimising any bindings as it cannot be sure of the names in any given scope.

Cheers,

Aaron




More information about the Development mailing list