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

Issue 10034026: Add optional arguments to NullPointerException so that it can report more information (make it simi… (Closed)

Created:
8 years, 8 months ago by srdjan
Modified:
8 years, 8 months ago
Reviewers:
gbracha, sra1, hausner
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Add optional arguments to NullPointerException so that it can report more information (make it similar to what is reported by NoSuchMethodException): NullPointerException : method: 'foo' Receiver: null Arguments: [1, 2] Committed: https://code.google.com/p/dart/source/detail?r=6429

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -4 lines) Patch
M corelib/src/exceptions.dart View 1 chunk +21 lines, -2 lines 2 comments Download
M runtime/lib/object.cc View 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
srdjan
8 years, 8 months ago (2012-04-11 18:55:56 UTC) #1
hausner
lgtm
8 years, 8 months ago (2012-04-11 19:29:38 UTC) #2
gbracha
lgtm
8 years, 8 months ago (2012-04-11 19:36:34 UTC) #3
sra1
8 years, 8 months ago (2012-04-11 20:43:12 UTC) #4
https://chromiumcodereview.appspot.com/10034026/diff/1/corelib/src/exceptions...
File corelib/src/exceptions.dart (right):

https://chromiumcodereview.appspot.com/10034026/diff/1/corelib/src/exceptions...
corelib/src/exceptions.dart:125: this.arguments = const[]]);
NullPointerException is called from hand written JS code in the Frog runtime.
Calling from hand written JS code has a constraint that optional argument
default values can only be null.
It is not possible in the hand-written code to find the 'global' variable
containing the shared const empty list.

It might be possible to change the call in the hand written code to explicitly
pass null and [].

https://chromiumcodereview.appspot.com/10034026/diff/1/corelib/src/exceptions...
corelib/src/exceptions.dart:132: if (functionName == null) {
Do this test first.  No need to allocate a StringBuffer if you don't use it.

Powered by Google App Engine
This is Rietveld 408576698