This is crbug.com/466993, fixed in V8 4.4+.

(And no, nothing is "optimized away", it's just a bug.)

On Sun, Apr 19, 2015 at 3:54 AM, Alexander Praetorius <
[email protected]> wrote:

>
> /******************************************************************************
>     Sloppy description
>
>       - No problem in ['node 0.12', 'firefox']
>       - Fails in ['iojs', 'new chrome']
>
>
> ******************************************************************************/
> // PREPARE
> var defaultKeys = { '0': '', '1': '', '2': '', '3': '' };
> var ROUNDS = 3;
>
> // RUN
> for (var idx=0; idx<ROUNDS; idx++) {
>
>   // BUG: assignment gets optimized away for ROUNDS > 2
>   var keys = { '0': '', '1': '', '2': '', '3': '' };
>
>   // ASSERT
>   assertDeepEqual(keys, defaultKeys);
>
>   for(var i=0; i<3; i++) {
>     keys[i] = 'foobar';
>   }
> }
>
>
>
> /******************************************************************************
>   ASSERT deep equal
>
> ******************************************************************************/
> function assertDeepEqual (keys, defaultKeys, msg) {
>   if (keys[0] === defaultKeys[0] &&
>       keys[1] === defaultKeys[1] &&
>       keys[2] === defaultKeys[2] &&
>       keys[3] === defaultKeys[3]) {
>   } else {
>     keys        = JSON.stringify(keys,null,2);
>     defaultKeys = JSON.stringify(defaultKeys,null,2);
>     console.debug(keys+' === '+defaultKeys);
>   }
> }
>
>  --
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to