Changeset 160592 in webkit


Ignore:
Timestamp:
Dec 13, 2013 11:53:44 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Some Set and Map prototype functions have incorrect function lengths
https://bugs.webkit.org/show_bug.cgi?id=125732

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2013-12-13
Reviewed by Oliver Hunt.

Source/JavaScriptCore:

  • runtime/MapPrototype.cpp:

(JSC::MapPrototype::finishCreation):

  • runtime/SetPrototype.cpp:

(JSC::SetPrototype::finishCreation):

LayoutTests:

  • js/basic-map-expected.txt:
  • js/basic-set-expected.txt:
  • js/script-tests/basic-map.js:
  • js/script-tests/basic-set.js:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r160588 r160592  
     12013-12-13  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Some Set and Map prototype functions have incorrect function lengths
     4        https://bugs.webkit.org/show_bug.cgi?id=125732
     5
     6        Reviewed by Oliver Hunt.
     7
     8        * js/basic-map-expected.txt:
     9        * js/basic-set-expected.txt:
     10        * js/script-tests/basic-map.js:
     11        * js/script-tests/basic-set.js:
     12
    1132013-12-13  Joseph Pecoraro  <pecoraro@apple.com>
    214
  • trunk/LayoutTests/js/basic-map-expected.txt

    r159008 r160592  
    2020PASS Map.prototype.hasOwnProperty('size') is true
    2121PASS Map.prototype.size threw exception TypeError: Map operation called on non-Map object.
     22PASS Map.prototype.set.length is 2
     23PASS Map.prototype.has.length is 1
     24PASS Map.prototype.get.length is 1
     25PASS Map.prototype.clear.length is 0
     26PASS Map.prototype.keys.length is 0
     27PASS Map.prototype.values.length is 0
     28PASS Map.prototype.entries.length is 0
    2229PASS map.size is 0
    2330PASS map.set(-0, 1) is map
  • trunk/LayoutTests/js/basic-set-expected.txt

    r159031 r160592  
    2727PASS Object.hasOwnProperty(set, 'size') is false
    2828PASS Set.prototype.hasOwnProperty('size') is true
    29 PASS Map.prototype.size threw exception TypeError: Map operation called on non-Map object.
     29PASS Set.prototype.size threw exception TypeError: Set operation called on non-Set object.
     30PASS Set.prototype.add.length is 1
     31PASS Set.prototype.has.length is 1
     32PASS Set.prototype.clear.length is 0
     33PASS Set.prototype.keys.length is 0
     34PASS Set.prototype.values.length is 0
     35PASS Set.prototype.entries.length is 0
    3036PASS set.size is 0
    3137PASS set.add(-0) is set
  • trunk/LayoutTests/js/script-tests/basic-map.js

    r159008 r160592  
    2222shouldBeTrue("Map.prototype.hasOwnProperty('size')")
    2323shouldThrow("Map.prototype.size")
     24
     25shouldBe("Map.prototype.set.length", "2")
     26shouldBe("Map.prototype.has.length", "1")
     27shouldBe("Map.prototype.get.length", "1")
     28shouldBe("Map.prototype.clear.length", "0")
     29shouldBe("Map.prototype.keys.length", "0")
     30shouldBe("Map.prototype.values.length", "0")
     31shouldBe("Map.prototype.entries.length", "0")
     32
    2433shouldBe("map.size", "0")
    2534shouldBe("map.set(-0, 1)", "map")
  • trunk/LayoutTests/js/script-tests/basic-set.js

    r159031 r160592  
    2626shouldBeFalse("Object.hasOwnProperty(set, 'size')")
    2727shouldBeTrue("Set.prototype.hasOwnProperty('size')")
    28 shouldThrow("Map.prototype.size")
     28shouldThrow("Set.prototype.size")
     29
     30shouldBe("Set.prototype.add.length", "1")
     31shouldBe("Set.prototype.has.length", "1")
     32shouldBe("Set.prototype.clear.length", "0")
     33shouldBe("Set.prototype.keys.length", "0")
     34shouldBe("Set.prototype.values.length", "0")
     35shouldBe("Set.prototype.entries.length", "0")
     36
    2937shouldBe("set.size", "0")
    3038shouldBe("set.add(-0)", "set")
  • trunk/Source/JavaScriptCore/ChangeLog

    r160588 r160592  
     12013-12-13  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Some Set and Map prototype functions have incorrect function lengths
     4        https://bugs.webkit.org/show_bug.cgi?id=125732
     5
     6        Reviewed by Oliver Hunt.
     7
     8        * runtime/MapPrototype.cpp:
     9        (JSC::MapPrototype::finishCreation):
     10        * runtime/SetPrototype.cpp:
     11        (JSC::SetPrototype::finishCreation):
     12
    1132013-12-13  Joseph Pecoraro  <pecoraro@apple.com>
    214
  • trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp

    r159008 r160592  
    6565    JSC_NATIVE_FUNCTION(vm.propertyNames->has, mapProtoFuncHas, DontEnum, 1);
    6666    JSC_NATIVE_FUNCTION(vm.propertyNames->set, mapProtoFuncSet, DontEnum, 2);
    67     JSC_NATIVE_FUNCTION(vm.propertyNames->keys, mapProtoFuncKeys, DontEnum, 2);
    68     JSC_NATIVE_FUNCTION(vm.propertyNames->values, mapProtoFuncValues, DontEnum, 2);
    69     JSC_NATIVE_FUNCTION(vm.propertyNames->entries, mapProtoFuncEntries, DontEnum, 2);
    70     JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorPrivateName, mapProtoFuncEntries, DontEnum, 2);
     67    JSC_NATIVE_FUNCTION(vm.propertyNames->keys, mapProtoFuncKeys, DontEnum, 0);
     68    JSC_NATIVE_FUNCTION(vm.propertyNames->values, mapProtoFuncValues, DontEnum, 0);
     69    JSC_NATIVE_FUNCTION(vm.propertyNames->entries, mapProtoFuncEntries, DontEnum, 0);
     70    JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorPrivateName, mapProtoFuncEntries, DontEnum, 0);
    7171
    7272    GetterSetter* accessor = GetterSetter::create(vm);
  • trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp

    r159031 r160592  
    5959    vm.prototypeMap.addPrototype(this);
    6060
    61     JSC_NATIVE_FUNCTION(vm.propertyNames->add, setProtoFuncAdd, DontEnum, 0);
    62     JSC_NATIVE_FUNCTION(vm.propertyNames->clear, setProtoFuncClear, DontEnum, 1);
     61    JSC_NATIVE_FUNCTION(vm.propertyNames->add, setProtoFuncAdd, DontEnum, 1);
     62    JSC_NATIVE_FUNCTION(vm.propertyNames->clear, setProtoFuncClear, DontEnum, 0);
    6363    JSC_NATIVE_FUNCTION(vm.propertyNames->deleteKeyword, setProtoFuncDelete, DontEnum, 1);
    6464    JSC_NATIVE_FUNCTION(vm.propertyNames->forEach, setProtoFuncForEach, DontEnum, 1);
Note: See TracChangeset for help on using the changeset viewer.