Undocumented, breaking FMS 4 changes

FMS 4 has been updated to use JavaScript 1.7, which has some features that might break your existing SSAS.

var loops = 0;
var obj = {
    key1: 'v1',
    key2: 'v2'
};
for(var iter in obj)
{
    delete obj['key1'];
    delete obj['key2'];
    loops++;
}
trace(loops);

FMS < 4 will print "2". FMS 4 will print "1".

Another change involves magic methods ("__method") there is apparently a new one called __iterator__.

var obj = {
    __resolve: function(propertyName)
    {
        return "hello";
    }
};
for(var iter in obj)
{
    trace(iter);
}

FMS < 4 will print nothing. FMS 4 will die at the for loop with the error: "TypeError: obj.__iterator__ returned a primitive value"

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s