diff options
author | barraclough@apple.com <barraclough@apple.com@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2011-10-18 17:04:32 +0000 |
---|---|---|
committer | barraclough@apple.com <barraclough@apple.com@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2011-10-18 17:04:32 +0000 |
commit | a2854624e3adda7ec9f8ae10c4e4a851dea39384 (patch) | |
tree | 0ebe7ac0c7717d5a63269541f686f57f27c5c557 | |
parent | 9a3cb86b83c11aa5bfcc97f5f055088cd17423e1 (diff) | |
download | chromium_src-a2854624e3adda7ec9f8ae10c4e4a851dea39384.zip chromium_src-a2854624e3adda7ec9f8ae10c4e4a851dea39384.tar.gz chromium_src-a2854624e3adda7ec9f8ae10c4e4a851dea39384.tar.bz2 |
Indexed arguments on the Arguments object should be enumerable.
https://bugs.webkit.org/show_bug.cgi?id=70302
Reviewed by Sam Weinig.
See ECMA-262 5.1 chapter 10.6 step 11b.
This is visible through a number of means, including Object.keys, Object.getOwnPropertyDescriptor, and operator in.
* fast/js/kde/function-expected.txt:
* fast/js/kde/script-tests/function.js:
(foo2):
- This tests using 'in'.
* fast/js/arguments-expected.txt:
* fast/js/script-tests/arguments.js:
(descriptor):
- This tests using 'Object.getOwnPropertyDescriptor'.
* ietestcenter/Javascript/15.2.3.14-3-4-expected.txt:
- This tests using 'Object.keys'.
git-svn-id: svn://svn.chromium.org/blink/trunk@97768 bbb929c8-8fbe-4397-9dbb-9b2b20218538
6 files changed, 35 insertions, 4 deletions
diff --git a/third_party/WebKit/LayoutTests/ChangeLog b/third_party/WebKit/LayoutTests/ChangeLog index 3e84cb9..623837c 100644 --- a/third_party/WebKit/LayoutTests/ChangeLog +++ b/third_party/WebKit/LayoutTests/ChangeLog @@ -1,3 +1,24 @@ +2011-10-18 Gavin Barraclough <barraclough@apple.com> + + Indexed arguments on the Arguments object should be enumerable. + https://bugs.webkit.org/show_bug.cgi?id=70302 + + Reviewed by Sam Weinig. + + See ECMA-262 5.1 chapter 10.6 step 11b. + This is visible through a number of means, including Object.keys, Object.getOwnPropertyDescriptor, and operator in. + + * fast/js/kde/function-expected.txt: + * fast/js/kde/script-tests/function.js: + (foo2): + - This tests using 'in'. + * fast/js/arguments-expected.txt: + * fast/js/script-tests/arguments.js: + (descriptor): + - This tests using 'Object.getOwnPropertyDescriptor'. + * ietestcenter/Javascript/15.2.3.14-3-4-expected.txt: + - This tests using 'Object.keys'. + 2011-10-18 Nate Chapin <japhet@chromium.org> Test update for https://bugs.webkit.org/show_bug.cgi?id=61225. diff --git a/third_party/WebKit/LayoutTests/fast/js/arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/js/arguments-expected.txt index f195a73..664bb3b 100644 --- a/third_party/WebKit/LayoutTests/fast/js/arguments-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/js/arguments-expected.txt @@ -134,6 +134,10 @@ PASS shadowedArgumentsLength([]) is 0 PASS shadowedArgumentsLength() threw exception TypeError: 'undefined' is not an object (evaluating 'arguments.length'). PASS shadowedArgumentsCallee([]) is undefined. PASS shadowedArgumentsIndex([true]) is true +PASS descriptor.value is "one" +PASS descriptor.writable is true +PASS descriptor.enumerable is true +PASS descriptor.configurable is true PASS successfullyParsed is true TEST COMPLETE diff --git a/third_party/WebKit/LayoutTests/fast/js/kde/function-expected.txt b/third_party/WebKit/LayoutTests/fast/js/kde/function-expected.txt index 52798d0..9d1a4085 100644 --- a/third_party/WebKit/LayoutTests/fast/js/kde/function-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/js/kde/function-expected.txt @@ -11,7 +11,7 @@ PASS f('bbbbb') is 'bbbbb' PASS foo() is '|' PASS foo('bar') is '|bar|' PASS foo('bar', 'x') is '|bar|x|' -PASS foo2(7) is 0 +PASS foo2(7) is 1 PASS foo3(0, 99) is 2 PASS foo3(1, 99).length is 2 PASS nest0(2,3) is 36 diff --git a/third_party/WebKit/LayoutTests/fast/js/kde/script-tests/function.js b/third_party/WebKit/LayoutTests/fast/js/kde/script-tests/function.js index c7c8693..45c7889 100644 --- a/third_party/WebKit/LayoutTests/fast/js/kde/script-tests/function.js +++ b/third_party/WebKit/LayoutTests/fast/js/kde/script-tests/function.js @@ -60,12 +60,12 @@ shouldBe("foo('bar', 'x')", "'|bar|x|'"); function foo2(a) { var i = 0; - for(a in arguments) // should NOT be enumerable + for(a in arguments) // should be enumerable i++; return i; } -shouldBe("foo2(7)", "0"); +shouldBe("foo2(7)", "1"); // I have my doubts about the standard conformance of this function foo3(i, j) { diff --git a/third_party/WebKit/LayoutTests/fast/js/script-tests/arguments.js b/third_party/WebKit/LayoutTests/fast/js/script-tests/arguments.js index 2ea1ba9..fd39492 100644 --- a/third_party/WebKit/LayoutTests/fast/js/script-tests/arguments.js +++ b/third_party/WebKit/LayoutTests/fast/js/script-tests/arguments.js @@ -556,4 +556,10 @@ shouldThrow("shadowedArgumentsLength()"); shouldBeUndefined("shadowedArgumentsCallee([])"); shouldBeTrue("shadowedArgumentsIndex([true])"); +descriptor = (function(){ return Object.getOwnPropertyDescriptor(arguments, 1); })("zero","one","two"); +shouldBe("descriptor.value", '"one"'); +shouldBe("descriptor.writable", 'true'); +shouldBe("descriptor.enumerable", 'true'); +shouldBe("descriptor.configurable", 'true'); + var successfullyParsed = true; diff --git a/third_party/WebKit/LayoutTests/ietestcenter/Javascript/15.2.3.14-3-4-expected.txt b/third_party/WebKit/LayoutTests/ietestcenter/Javascript/15.2.3.14-3-4-expected.txt index 7e52c58..5a975d4 100644 --- a/third_party/WebKit/LayoutTests/ietestcenter/Javascript/15.2.3.14-3-4-expected.txt +++ b/third_party/WebKit/LayoutTests/ietestcenter/Javascript/15.2.3.14-3-4-expected.txt @@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE PASS ES5Harness.preconditionPassed is true -FAIL ES5Harness.testPassed should be true (of type boolean). Was undefined (of type undefined). +PASS ES5Harness.testPassed is true PASS successfullyParsed is true TEST COMPLETE |