DescriptionMake 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. #Messages
Total messages: 4 (1 generated)
|