OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 assertEquals(typeof(should_throw_on_null_and_undefined[i]), "function"); | 161 assertEquals(typeof(should_throw_on_null_and_undefined[i]), "function"); |
162 | 162 |
163 var exception = false; | 163 var exception = false; |
164 try { | 164 try { |
165 // We call all functions with no parameters, which means that essential | 165 // We call all functions with no parameters, which means that essential |
166 // parameters will have the undefined value. | 166 // parameters will have the undefined value. |
167 // The test for whether the "this" value is null or undefined is always | 167 // The test for whether the "this" value is null or undefined is always |
168 // performed before access to the other parameters, so even if the | 168 // performed before access to the other parameters, so even if the |
169 // undefined value is an invalid argument value, it mustn't change | 169 // undefined value is an invalid argument value, it mustn't change |
170 // the result of the test. | 170 // the result of the test. |
171 print(i); | |
dcarney
2014/01/13 18:35:03
debuggage
| |
171 should_throw_on_null_and_undefined[i].call(null); | 172 should_throw_on_null_and_undefined[i].call(null); |
172 } catch (e) { | 173 } catch (e) { |
173 exception = true; | 174 exception = true; |
174 checkExpectedMessage(e); | 175 checkExpectedMessage(e); |
175 } | 176 } |
176 assertTrue(exception); | 177 assertTrue(exception); |
177 | 178 |
178 exception = false; | 179 exception = false; |
179 try { | 180 try { |
180 should_throw_on_null_and_undefined[i].call(undefined); | 181 should_throw_on_null_and_undefined[i].call(undefined); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
347 } | 348 } |
348 } | 349 } |
349 | 350 |
350 | 351 |
351 // Object.prototype.toString() | 352 // Object.prototype.toString() |
352 assertEquals(Object.prototype.toString.call(null), | 353 assertEquals(Object.prototype.toString.call(null), |
353 '[object Null]') | 354 '[object Null]') |
354 | 355 |
355 assertEquals(Object.prototype.toString.call(undefined), | 356 assertEquals(Object.prototype.toString.call(undefined), |
356 '[object Undefined]') | 357 '[object Undefined]') |
OLD | NEW |