Skip to content

Commit

Permalink
Use better test for UnsupportedClassVersionError.
Browse files Browse the repository at this point in the history
The previous test worked correctly with the Oracle JVM but
failed with other JVMs. This new test should work correctly
on all JVMs.
  • Loading branch information
jimlloyd committed Nov 18, 2014
1 parent aa920cc commit 2d60bf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test8/testLambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports['Java8'] = nodeunit.testCase({
test.equal(diff, -19);
}
catch (err) {
var unsupportedVersion = err.toString().match(/Unsupported major.minor version 52.0/)
var unsupportedVersion = java.instanceOf(err.cause, 'java.lang.UnsupportedClassVersionError');
test.ok(unsupportedVersion);
if (unsupportedVersion)
console.log('JRE 1.8 not available');
Expand Down

0 comments on commit 2d60bf6

Please sign in to comment.