Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: test/mjsunit/function-call.js

Issue 131663003: Make the strict-mode calling convention for contextual calls the default one. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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]')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698