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

Issue 692463002: Make Expect.throws not accept arguments that fail to be called. (Closed)

Created:
6 years, 1 month ago by Lasse Reichstein Nielsen
Modified:
6 years, 1 month ago
Reviewers:
zerny-google
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Make Expect.throws not accept arguments that fail to be called. Expect.throws calls its first argument, f, with no arguments. If f isn't callable in this way, the act of calling would throw, and this throw would be considered as makeing the Expect.throws succeeede. Now we check the argument first, and call it outside the try/catch if it's not callable. This was already caught in checked mode, but we shouldn't accept a false positive in unchecked mode either. R=zerny@google.com Committed: https://code.google.com/p/dart/source/detail?r=41392

Patch Set 1 #

Patch Set 2 : Don't call f. It might succeede through noSuchMethod. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -4 lines) Patch
M pkg/expect/lib/expect.dart View 1 2 chunks +9 lines, -4 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
Lasse Reichstein Nielsen
6 years, 1 month ago (2014-10-29 09:57:15 UTC) #2
zerny-google
lgtm
6 years, 1 month ago (2014-10-29 10:03:37 UTC) #3
Lasse Reichstein Nielsen
6 years, 1 month ago (2014-10-29 10:06:57 UTC) #4
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as 41392 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698