Changeset 159063 in webkit


Ignore:
Timestamp:
Nov 11, 2013 12:53:13 PM (10 years ago)
Author:
oliver@apple.com
Message:

ExtJS breaks with modern Array.prototype.values API due to use of with()
https://bugs.webkit.org/show_bug.cgi?id=123440

Reviewed by Beth Dakin.

Source/JavaScriptCore:

As with our attempt to make Arguments use the Array prototype, ExtJS has
a weird dependency on not adding new APIs to core types. In this case
Array.prototype.values. The fix is to remove it, and push for ES6 to drop
the API.

  • runtime/ArrayPrototype.cpp:

LayoutTests:

Update tests for removal of Array.prototype.values, and add test to ensure that
it's gone.

  • js/Object-getOwnPropertyNames-expected.txt:
  • js/array-iterators-expected.txt:
  • js/basic-for-of-expected.txt:
  • js/script-tests/Object-getOwnPropertyNames.js:
  • js/script-tests/array-iterators.js:
  • js/script-tests/basic-for-of.js:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r159062 r159063  
     12013-11-11  Oliver Hunt  <oliver@apple.com>
     2
     3        ExtJS breaks with modern Array.prototype.values API due to use of with()
     4        https://bugs.webkit.org/show_bug.cgi?id=123440
     5
     6        Reviewed by Beth Dakin.
     7
     8        Update tests for removal of Array.prototype.values, and add test to ensure that
     9        it's gone.
     10
     11        * js/Object-getOwnPropertyNames-expected.txt:
     12        * js/array-iterators-expected.txt:
     13        * js/basic-for-of-expected.txt:
     14        * js/script-tests/Object-getOwnPropertyNames.js:
     15        * js/script-tests/array-iterators.js:
     16        * js/script-tests/basic-for-of.js:
     17
    1182013-11-11  Oliver Hunt  <oliver@apple.com>
    219
  • trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt

    r158401 r159063  
    4646PASS getSortedOwnPropertyNames(Function.prototype) is ['apply', 'bind', 'call', 'constructor', 'length', 'name', 'toString']
    4747PASS getSortedOwnPropertyNames(Array) is ['isArray', 'length', 'name', 'prototype']
    48 PASS getSortedOwnPropertyNames(Array.prototype) is ['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']
     48PASS getSortedOwnPropertyNames(Array.prototype) is ['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']
    4949PASS getSortedOwnPropertyNames(String) is ['fromCharCode', 'length', 'name', 'prototype']
    5050PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'fixed', 'fontcolor', 'fontsize', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'replace', 'search', 'slice', 'small', 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']
  • trunk/LayoutTests/js/array-iterators-expected.txt

    r157267 r159063  
    44
    55
     6PASS 'values' in [] is false
    67PASS key is 0
    78PASS key is 1
     
    1011PASS key is 4
    1112PASS key is 5
    12 PASS testArray.length is 6
    13 PASS value is 1
    14 PASS value is 2
    15 PASS value is 3
    16 PASS value is 4
    17 PASS value is 5
    18 PASS value is 6
    1913PASS testArray.length is 6
    2014PASS value is testArray[key]
  • trunk/LayoutTests/js/basic-for-of-expected.txt

    r156910 r159063  
    44
    55
    6 PASS value is testArray[0]
    7 PASS value is testArray[1]
    8 PASS value is testArray[2]
    9 PASS value is testArray[3]
    10 PASS value is testArray[4]
    11 PASS value is testArray[5]
    12 PASS testArray.length is 6
    136PASS value is testArray[0]
    147PASS value is testArray[1]
  • trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js

    r158401 r159063  
    5454    "Function.prototype": "['apply', 'bind', 'call', 'constructor', 'length', 'name', 'toString']",
    5555    "Array": "['isArray', 'length', 'name', 'prototype']",
    56     "Array.prototype": "['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']",
     56    "Array.prototype": "['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']",
    5757    "String": "['fromCharCode', 'length', 'name', 'prototype']",
    5858    "String.prototype": "['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'fixed', 'fontcolor', 'fontsize', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'replace', 'search', 'slice', 'small', 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']",
  • trunk/LayoutTests/js/script-tests/array-iterators.js

    r157267 r159063  
    33);
    44
     5shouldBeFalse("'values' in []");
    56
    67var testArray = [1,2,3,4,5,6]
     
    1011    shouldBe("key", String(i))
    1112    i++;
    12 }
    13 
    14 shouldBe("testArray.length", String(i))
    15 
    16 var values = testArray.values();
    17 var i = 0;
    18 for (var value of values) {
    19     i++;
    20     shouldBe("value", String(i) )
    2113}
    2214
  • trunk/LayoutTests/js/script-tests/basic-for-of.js

    r156920 r159063  
    55
    66var testArray = [1,2,3,4,5,6]
    7 
    8 var i = 0;
    9 for (var value of testArray.values())
    10     shouldBe("value", "testArray[" + i++ + "]")
    11 
    12 shouldBe("testArray.length", String(i))
    137
    148var i = 0;
  • trunk/Source/JavaScriptCore/ChangeLog

    r159055 r159063  
     12013-11-11  Oliver Hunt  <oliver@apple.com>
     2
     3        ExtJS breaks with modern Array.prototype.values API due to use of with()
     4        https://bugs.webkit.org/show_bug.cgi?id=123440
     5
     6        Reviewed by Beth Dakin.
     7
     8        As with our attempt to make Arguments use the Array prototype, ExtJS has
     9        a weird dependency on not adding new APIs to core types.  In this case
     10        Array.prototype.values.  The fix is to remove it, and push for ES6 to drop
     11        the API.
     12
     13        * runtime/ArrayPrototype.cpp:
     14
    1152013-11-11  Gabor Rapcsanyi  <rgabor@webkit.org>
    216
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r156910 r159063  
    117117  reduceRight    arrayProtoFuncReduceRight    DontEnum|Function 1
    118118  map            arrayProtoFuncMap            DontEnum|Function 1
    119   values         arrayProtoFuncValues         DontEnum|Function 0
    120119  entries        arrayProtoFuncEntries        DontEnum|Function 0
    121120  keys           arrayProtoFuncKeys           DontEnum|Function 0
Note: See TracChangeset for help on using the changeset viewer.