Bug Tracker

Changes between Initial Version and Version 1 of Ticket #13759, comment 6


Ignore:
Timestamp:
Apr 10, 2013, 12:09:32 PM (9 years ago)
Author:
m_gol
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13759, comment 6

    initial v1  
    55Anyway, the spec must be more complicated than what I anticipaded. The following code provides the same results in Chrome, Firefox, Opera & IE10 (IE9 results in [0, 1, ..., 7]):
    66{{{
    7 var results = [];
     7(function ( undefined ) {
     8        console.log('0: ' + undefined);
     9})( 0 ); // => 0
    810
    9 var undefined = 0;
    10 results.push((function () {
    11         return undefined;
    12 })()); // => undefined
     11(function ( undefined ) {
     12        'use strict';
     13        console.log('1: ' + undefined);
     14})( 1 ); // => 1
    1315
    14 var undefined = 1;
    15 results.push((function () {
     16(function () {
     17        undefined = 2;
     18        console.log('2: ' + undefined);
     19})(); // => 2
     20
     21(function () {
    1622        'use strict';
    17         return undefined;
    18 })()); // => undefined
     23        try {
     24                undefined = 3;
     25                console.log('3: ' + undefined);
     26        } catch (e) {
     27                console.log('3: ' + e);
     28        }
     29})(); // => TypeError
    1930
    20 results.push((function ( undefined ) {
    21         return undefined;
    22 })( 2 )); // => 2
     31(function () {
     32        var undefined = 4;
     33        console.log('4: ' + undefined);
     34})(); // => 4
    2335
    24 results.push((function ( undefined ) {
    25         'use strict';
    26         return undefined;
    27 })( 3 )); // => 3
    28 
    29 results.push((function () {
    30         var undefined = 4;
    31         return undefined;
    32 })()); // => 4
    33 
    34 results.push((function () {
     36(function () {
    3537        'use strict';
    3638        var undefined = 5;
    37         return undefined;
    38 })()); // => 5
     39        console.log('5: ' + undefined);
     40})(); // => 5
    3941
    40 results.push((function () {
    41         undefined = 6;
    42         return undefined;
    43 })()); // => 6
     42var undefined = 6;
     43(function () {
     44        console.log('6: ' + undefined);
     45})(); // => undefined
    4446
    45 results.push((function () {
     47var undefined = 7;
     48(function () {
    4649        'use strict';
    47         try {
    48                 undefined = 7;
    49                 return undefined;
    50         } catch (e) {
    51                 return e;
    52         }
    53 })()); // => TypeError
    54 
    55 results; // [undefined, undefined, 2, 3, 4, 5, undefined, TypeError]
     50        console.log('7: ' + undefined);
     51})(); // => undefined
    5652}}}