OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 CheckCoersion.call(undefined); | 72 CheckCoersion.call(undefined); |
73 CheckCoersion.call(null); | 73 CheckCoersion.call(null); |
74 [1].forEach(CheckCoersion, "foo"); | 74 [1].forEach(CheckCoersion, "foo"); |
75 [2].every(CheckCoersion, "foo"); | 75 [2].every(CheckCoersion, "foo"); |
76 [3].filter(CheckCoersion, "foo"); | 76 [3].filter(CheckCoersion, "foo"); |
77 [4].some(CheckCoersion, 42); | 77 [4].some(CheckCoersion, 42); |
78 [5].map(CheckCoersion, 42); | 78 [5].map(CheckCoersion, 42); |
79 }; | 79 }; |
80 strict_mode(); | 80 strict_mode(); |
81 | 81 |
82 function classic_mode() { | 82 function sloppy_mode() { |
83 CheckStringReceiver.call("foo"); | 83 CheckStringReceiver.call("foo"); |
84 CheckNumberReceiver.call(42); | 84 CheckNumberReceiver.call(42); |
85 CheckUndefinedReceiver.call(undefined); | 85 CheckUndefinedReceiver.call(undefined); |
86 CheckNullReceiver.call(null); | 86 CheckNullReceiver.call(null); |
87 [1].forEach(CheckStringReceiver, "foo"); | 87 [1].forEach(CheckStringReceiver, "foo"); |
88 [2].every(CheckStringReceiver, "foo"); | 88 [2].every(CheckStringReceiver, "foo"); |
89 [3].filter(CheckStringReceiver, "foo"); | 89 [3].filter(CheckStringReceiver, "foo"); |
90 [4].some(CheckNumberReceiver, 42); | 90 [4].some(CheckNumberReceiver, 42); |
91 [5].map(CheckNumberReceiver, 42); | 91 [5].map(CheckNumberReceiver, 42); |
92 | 92 |
93 CheckCoersion.call("foo"); | 93 CheckCoersion.call("foo"); |
94 CheckCoersion.call(42); | 94 CheckCoersion.call(42); |
95 CheckCoersion.call(undefined); | 95 CheckCoersion.call(undefined); |
96 CheckCoersion.call(null); | 96 CheckCoersion.call(null); |
97 [1].forEach(CheckCoersion, "foo"); | 97 [1].forEach(CheckCoersion, "foo"); |
98 [2].every(CheckCoersion, "foo"); | 98 [2].every(CheckCoersion, "foo"); |
99 [3].filter(CheckCoersion, "foo"); | 99 [3].filter(CheckCoersion, "foo"); |
100 [4].some(CheckCoersion, 42); | 100 [4].some(CheckCoersion, 42); |
101 [5].map(CheckCoersion, 42); | 101 [5].map(CheckCoersion, 42); |
102 }; | 102 }; |
103 classic_mode(); | 103 sloppy_mode(); |
OLD | NEW |