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

Issue 9307074: If programmer mistakes the number of arguments, VM throws noSuchMethod. Extend reporting to repor... (Closed)

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

Description

If programmer mistakes the number of arguments, VM throws noSuchMethod. Extend reporting to report correct number/name of arguments if a method with the same name exists. Example: NoSuchMethodException - receiver: 'Instance of 'A'' function name: 'foo' arguments: [1]] Found 'foo(alpha, beta, message)' 0. Function: 'Object.noSuchMethod' url: 'bootstrap' line:647 col:3 1. Function: '::main' url: '/sources/chinstrap/dart/runtime/Test.dart' line:8 col:8 Committed: https://code.google.com/p/dart/source/detail?r=3911

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

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

Messages

Total messages: 4 (0 generated)
srdjan
8 years, 10 months ago (2012-02-02 23:26:09 UTC) #1
siva
lgtm
8 years, 10 months ago (2012-02-03 01:07:59 UTC) #2
ahe
This is great! Did you consider making the message a little more symmetric: NoSuchMethodException: incorrect ...
8 years, 10 months ago (2012-02-03 17:33:58 UTC) #3
srdjan
8 years, 10 months ago (2012-02-03 18:34:53 UTC) #4
On 2012/02/03 17:33:58, ahe wrote:
> This is great!
> 
> Did you consider making the message a little more symmetric:
> 
> NoSuchMethodException: incorrect number of arguments passed to method named
> 'foo' in class 'A'.
> Receiver: 'Instance of 'A''
> Tried calling: foo(1)
> But found: 'foo(alpha, beta, message)'

Will change it as suggested.

Powered by Google App Engine
This is Rietveld 408576698