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

Issue 11415028: Remove NullPointerException. (Closed)

Created:
8 years, 1 month ago by Lasse Reichstein Nielsen
Modified:
7 years, 10 months ago
Reviewers:
ahe, regis, floitsch, ngeoffray
CC:
reviews_dartlang.org, gbracha
Visibility:
Public.

Description

Remove NullPointerException. Accessing non-existing members on null now throws NoSuchMethodError. Throwing a null value fails by throwing a NullThrownError. Methods checking for null now generally throw new ArgumentError(null). Committed: https://code.google.com/p/dart/source/detail?r=15061 Committed: https://code.google.com/p/dart/source/detail?r=15136

Patch Set 1 #

Patch Set 2 : Added analyzer co19 expectations. #

Total comments: 7

Patch Set 3 : Addressed review comments. #

Total comments: 4

Patch Set 4 : Fixed VM bugs. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+545 lines, -342 lines) Patch
M pkg/fixnum/lib/src/int32.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M pkg/fixnum/lib/src/int64.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M pkg/fixnum/test/int_32_test.dart View 1 chunk +8 lines, -8 lines 0 comments Download
M pkg/fixnum/test/int_64_test.dart View 1 chunk +8 lines, -8 lines 0 comments Download
M pkg/unittest/lib/src/core_matchers.dart View 1 chunk +0 lines, -12 lines 0 comments Download
M pkg/unittest/test/matchers_test.dart View 1 chunk +0 lines, -10 lines 0 comments Download
M runtime/lib/double.dart View 1 chunk +3 lines, -1 line 0 comments Download
M runtime/lib/expando_patch.dart View 1 chunk +1 line, -4 lines 0 comments Download
M runtime/lib/object.cc View 1 2 3 1 chunk +1 line, -7 lines 0 comments Download
M runtime/lib/regexp.cc View 1 2 3 2 chunks +0 lines, -12 lines 0 comments Download
M runtime/lib/regexp_patch.dart View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/lib/string.cc View 1 2 3 1 chunk +0 lines, -4 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 1 chunk +0 lines, -6 lines 0 comments Download
M runtime/vm/exceptions.h View 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/exceptions.cc View 2 chunks +3 lines, -7 lines 0 comments Download
M runtime/vm/snapshot.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/compiler.dart View 1 chunk +1 line, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/core_patch.dart View 1 2 3 3 chunks +0 lines, -4 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/interceptors.dart View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_helper.dart View 1 2 13 chunks +8 lines, -18 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/optimize.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/core/errors.dart View 1 2 3 1 chunk +9 lines, -1 line 0 comments Download
M sdk/lib/core/exceptions.dart View 1 2 3 1 chunk +0 lines, -19 lines 0 comments Download
M sdk/lib/core/map.dart View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M tests/co19/co19-compiler.status View 1 1 chunk +96 lines, -0 lines 0 comments Download
M tests/co19/co19-dart2dart.status View 3 chunks +109 lines, -10 lines 0 comments Download
M tests/co19/co19-dart2js.status View 4 chunks +111 lines, -14 lines 0 comments Download
M tests/co19/co19-runtime.status View 5 chunks +110 lines, -14 lines 0 comments Download
M tests/compiler/dart2js_foreign/dart2js_foreign.status View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M tests/compiler/dart2js_native/dart2js_native.status View 1 2 3 1 chunk +3 lines, -0 lines 1 comment Download
M tests/corelib/core_runtime_types_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M tests/corelib/corelib.status View 3 chunks +2 lines, -4 lines 0 comments Download
M tests/corelib/expando_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/corelib/null_nosuchmethod_test.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M tests/corelib/reg_exp4_test.dart View 1 chunk +20 lines, -20 lines 0 comments Download
M tests/corelib/reg_exp5_test.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M tests/language/arithmetic2_test.dart View 1 chunk +0 lines, -2 lines 0 comments Download
M tests/language/call_through_null_getter_test.dart View 1 chunk +12 lines, -30 lines 0 comments Download
M tests/language/closure3_test.dart View 2 chunks +2 lines, -8 lines 0 comments Download
M tests/language/exception_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/language.status View 2 chunks +0 lines, -4 lines 0 comments Download
M tests/language/method_invocation_test.dart View 2 chunks +2 lines, -2 lines 0 comments Download
A + tests/language/null_access_error_test.dart View 1 2 1 chunk +14 lines, -14 lines 0 comments Download
D tests/language/null_pointer_exception_test.dart View 1 2 1 chunk +0 lines, -49 lines 0 comments Download
D tests/language/string_interpolate_npe_test.dart View 1 2 1 chunk +0 lines, -22 lines 0 comments Download
A + tests/language/string_interpolate_null_test.dart View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M tools/utils/vim/syntax/dart.vim View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
Lasse Reichstein Nielsen
8 years, 1 month ago (2012-11-16 12:18:45 UTC) #1
ngeoffray
dart2js changes LGTM https://codereview.chromium.org/11415028/diff/3001/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart File sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (right): https://codereview.chromium.org/11415028/diff/3001/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart#newcode754 sdk/lib/_internal/compiler/implementation/ssa/optimize.dart:754: // a NoSuchMethodError Keep the '.' ...
8 years, 1 month ago (2012-11-16 12:41:30 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/11415028/diff/3001/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart File sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (right): https://codereview.chromium.org/11415028/diff/3001/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart#newcode754 sdk/lib/_internal/compiler/implementation/ssa/optimize.dart:754: // a NoSuchMethodError Well spotted! https://codereview.chromium.org/11415028/diff/3001/sdk/lib/core/map.dart File sdk/lib/core/map.dart (right): ...
8 years, 1 month ago (2012-11-16 15:32:23 UTC) #3
floitsch
LGTM. https://codereview.chromium.org/11415028/diff/3001/tests/language/null_pointer_exception_test.dart File tests/language/null_pointer_exception_test.dart (right): https://codereview.chromium.org/11415028/diff/3001/tests/language/null_pointer_exception_test.dart#newcode5 tests/language/null_pointer_exception_test.dart:5: class NullAccessTest { rename file. https://codereview.chromium.org/11415028/diff/3001/tests/language/string_interpolate_npe_test.dart File tests/language/string_interpolate_npe_test.dart ...
8 years, 1 month ago (2012-11-16 16:38:44 UTC) #4
floitsch
LGTM.
8 years, 1 month ago (2012-11-16 16:38:45 UTC) #5
Lasse Reichstein Nielsen
8 years, 1 month ago (2012-11-19 08:52:45 UTC) #6
Lasse Reichstein Nielsen
This crashes in the VM X64 build. Any ideas why? https://codereview.chromium.org/11415028/diff/10001/runtime/lib/regexp.cc File runtime/lib/regexp.cc (left): https://codereview.chromium.org/11415028/diff/10001/runtime/lib/regexp.cc#oldcode27 ...
8 years, 1 month ago (2012-11-19 15:02:48 UTC) #7
regis
LGTM https://codereview.chromium.org/11415028/diff/10001/runtime/lib/object.cc File runtime/lib/object.cc (right): https://codereview.chromium.org/11415028/diff/10001/runtime/lib/object.cc#newcode29 runtime/lib/object.cc:29: Exceptions::ThrowByType(Exceptions::kNullThrown, args); We called a method on null. ...
8 years, 1 month ago (2012-11-19 19:45:31 UTC) #8
Lasse Reichstein Nielsen
https://codereview.chromium.org/11415028/diff/10001/runtime/lib/object.cc File runtime/lib/object.cc (right): https://codereview.chromium.org/11415028/diff/10001/runtime/lib/object.cc#newcode29 runtime/lib/object.cc:29: Exceptions::ThrowByType(Exceptions::kNullThrown, args); Noooo, kNullThrown is wrong! We should just ...
8 years, 1 month ago (2012-11-20 09:21:11 UTC) #9
ahe
7 years, 10 months ago (2013-01-29 17:17:10 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/11415028/diff/5003/tests/compiler/dart2js_nat...
File tests/compiler/dart2js_native/dart2js_native.status (right):

https://codereview.chromium.org/11415028/diff/5003/tests/compiler/dart2js_nat...
tests/compiler/dart2js_native/dart2js_native.status:9:
native_null_closure_frog_test: Fail
I'd appreciate if you would file a bug when you mark tests as failing.

Powered by Google App Engine
This is Rietveld 408576698