| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --allow-natives-syntax |
| 6 |
| 5 // TODO(jkummerow): There are many ways to improve these tests, e.g.: | 7 // TODO(jkummerow): There are many ways to improve these tests, e.g.: |
| 6 // - more variance in randomized inputs | 8 // - more variance in randomized inputs |
| 7 // - better time complexity management | 9 // - better time complexity management |
| 8 // - better code readability and documentation of intentions. | 10 // - better code readability and documentation of intentions. |
| 9 | 11 |
| 10 var RUN_WITH_ALL_ARGUMENT_ENTRIES = false; | 12 var RUN_WITH_ALL_ARGUMENT_ENTRIES = false; |
| 11 var kOnManyArgumentsRemove = 5; | 13 var kOnManyArgumentsRemove = 5; |
| 12 | 14 |
| 13 function makeArguments() { | 15 function makeArguments() { |
| 14 var result = [ ]; | 16 var result = [ ]; |
| 15 result.push(17); | 17 result.push(17); |
| 16 result.push(-31); | 18 result.push(-31); |
| 17 result.push(new Array(100)); | 19 result.push(new Array(100)); |
| 18 result.push(new Array(100003)); | 20 var a = %NormalizeElements([]); |
| 21 a.length = 100003; |
| 22 result.push(a); |
| 19 result.push(Number.MIN_VALUE); | 23 result.push(Number.MIN_VALUE); |
| 20 result.push("whoops"); | 24 result.push("whoops"); |
| 21 result.push("x"); | 25 result.push("x"); |
| 22 result.push({"x": 1, "y": 2}); | 26 result.push({"x": 1, "y": 2}); |
| 23 var slowCaseObj = {"a": 3, "b": 4, "c": 5}; | 27 var slowCaseObj = {"a": 3, "b": 4, "c": 5}; |
| 24 delete slowCaseObj.c; | 28 delete slowCaseObj.c; |
| 25 result.push(slowCaseObj); | 29 result.push(slowCaseObj); |
| 26 result.push(function () { return 8; }); | 30 result.push(function () { return 8; }); |
| 27 return result; | 31 return result; |
| 28 } | 32 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 func.apply(void 0, argList); | 94 func.apply(void 0, argList); |
| 91 } catch (e) { | 95 } catch (e) { |
| 92 // we don't care what happens as long as we don't crash | 96 // we don't care what happens as long as we don't crash |
| 93 } | 97 } |
| 94 type++; | 98 type++; |
| 95 } | 99 } |
| 96 } | 100 } |
| 97 | 101 |
| 98 testArgumentCount(NAME, ARGC); | 102 testArgumentCount(NAME, ARGC); |
| 99 testArgumentTypes(NAME, ARGC); | 103 testArgumentTypes(NAME, ARGC); |
| OLD | NEW |