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

Side by Side Diff: lib/compiler/implementation/lib/js_helper.dart

Issue 10689040: Throw a NullPointerException when throwing null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library('js_helper'); 5 #library('js_helper');
6 6
7 #import('coreimpl.dart'); 7 #import('coreimpl.dart');
8 8
9 #source('constant_map.dart'); 9 #source('constant_map.dart');
10 #source('native_helper.dart'); 10 #source('native_helper.dart');
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 } 750 }
751 751
752 static double random() => JS('double', @'Math.random()'); 752 static double random() => JS('double', @'Math.random()');
753 } 753 }
754 754
755 /** 755 /**
756 * Called by generated code to capture the stacktrace before throwing 756 * Called by generated code to capture the stacktrace before throwing
757 * an exception. 757 * an exception.
758 */ 758 */
759 captureStackTrace(ex) { 759 captureStackTrace(ex) {
760 if (ex === null) ex = const NullPointerException();
760 var jsError = JS('Object', @'new Error()'); 761 var jsError = JS('Object', @'new Error()');
761 JS('void', @'#.dartException = #', jsError, ex); 762 JS('void', @'#.dartException = #', jsError, ex);
762 JS('void', @'''#.toString = #''', jsError, 763 JS('void', @'''#.toString = #''', jsError,
763 DART_CLOSURE_TO_JS(toStringWrapper)); 764 DART_CLOSURE_TO_JS(toStringWrapper));
764 return jsError; 765 return jsError;
765 } 766 }
766 767
767 /** 768 /**
768 * This method is installed as JavaScript toString method on exception 769 * This method is installed as JavaScript toString method on exception
769 * objects in [captureStackTrace]. So JavaScript 'this' binds to an 770 * objects in [captureStackTrace]. So JavaScript 'this' binds to an
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 propertyTypeCastError(value, property); 1185 propertyTypeCastError(value, property);
1185 } 1186 }
1186 1187
1187 /** 1188 /**
1188 * Special interface recognized by the compiler and implemented by DOM 1189 * Special interface recognized by the compiler and implemented by DOM
1189 * objects that support integer indexing. This interface is not 1190 * objects that support integer indexing. This interface is not
1190 * visible to anyone, and is only injected into special libraries. 1191 * visible to anyone, and is only injected into special libraries.
1191 */ 1192 */
1192 interface JavaScriptIndexingBehavior { 1193 interface JavaScriptIndexingBehavior {
1193 } 1194 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698