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

Issue 9408001: Throw NoSuchMethod or IllegalArgument on bad operators or bad arguments to (Closed)

Created:
8 years, 10 months ago by floitsch
Modified:
8 years, 10 months ago
Reviewers:
kasperl
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Throw NoSuchMethod or IllegalArgument on bad operators or bad arguments to binary expressions. Fixes Issue 1588 Committed: https://code.google.com/p/dart/source/detail?r=4260

Patch Set 1 #

Total comments: 10

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -54 lines) Patch
M frog/corejs.dart View 1 9 chunks +86 lines, -53 lines 0 comments Download
M tests/language/language.status View 1 1 chunk +0 lines, -1 line 0 comments Download
M tests/language/language-leg.status View 1 chunk +1 line, -0 lines 0 comments Download
A tests/language/src/Arithmetic2Test.dart View 1 chunk +70 lines, -0 lines 0 comments Download
M tests/language/src/StringConcatTest.dart View 1 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
floitsch
8 years, 10 months ago (2012-02-15 11:43:08 UTC) #1
kasperl
LGTM. https://chromiumcodereview.appspot.com/9408001/diff/1/frog/corejs.dart File frog/corejs.dart (right): https://chromiumcodereview.appspot.com/9408001/diff/1/frog/corejs.dart#newcode49 frog/corejs.dart:49: world.gen.markTypeUsed(world.corelib.types['NoSuchMethodException']); How about adding a helper for this ...
8 years, 10 months ago (2012-02-15 11:54:48 UTC) #2
floitsch
8 years, 10 months ago (2012-02-15 13:11:42 UTC) #3
https://chromiumcodereview.appspot.com/9408001/diff/1/frog/corejs.dart
File frog/corejs.dart (right):

https://chromiumcodereview.appspot.com/9408001/diff/1/frog/corejs.dart#newcode49
frog/corejs.dart:49:
world.gen.markTypeUsed(world.corelib.types['NoSuchMethodException']);
On 2012/02/15 11:54:49, kasperl wrote:
> How about adding a helper for this statement?

Done.

https://chromiumcodereview.appspot.com/9408001/diff/1/frog/corejs.dart#newcod...
frog/corejs.dart:209: return (typeof(x) != 'object') ? x !== y : !x.$eq(y);
On 2012/02/15 11:54:49, kasperl wrote:
> This changes things for functions, right? I guess that's intentional?

AFAICS functions don't override the $eq method and would use the one on
Object.prototype which does ===. So everything stays the same.

https://chromiumcodereview.appspot.com/9408001/diff/1/frog/corejs.dart#newcod...
frog/corejs.dart:242: if (typeof(x) == 'number') {
On 2012/02/15 11:54:49, kasperl wrote:
> It's hard to understand what this does for performance. Would it be possible
to
> only cover the number case in this method and call some other method
> $add$complex for the other cases so the simple case can be inlined without
> dragging everything in? This might make sense for the generic _otherOperator
> too.

Done.

https://chromiumcodereview.appspot.com/9408001/diff/1/frog/corejs.dart#newcod...
frog/corejs.dart:263: if  (typeof(y) == 'number') {
On 2012/02/15 11:54:49, kasperl wrote:
> if  ( -> if (

Done.

https://chromiumcodereview.appspot.com/9408001/diff/1/tests/language/src/Stri...
File tests/language/src/StringConcatTest.dart (right):

https://chromiumcodereview.appspot.com/9408001/diff/1/tests/language/src/Stri...
tests/language/src/StringConcatTest.dart:49: // TODO(floitsch):
IllegalArgumentException might not be correct.
On 2012/02/15 11:54:49, kasperl wrote:
> Maybe explain this one a bit better? Is the string concatenation operator
> throwing the wrong argument? I guess so.

Done.

Powered by Google App Engine
This is Rietveld 408576698