intertype
Advanced tools
Comparing version 10.1.2 to 10.1.3
@@ -353,5 +353,4 @@ (function() { | ||
}, | ||
"x.errors in [ false, 'throw', ]": function(x) { | ||
var ref1; | ||
return (ref1 = x.errors) === false || ref1 === 'throw'; | ||
"@isa.boolean x.errors": function(x) { | ||
return this.isa.boolean(x.errors); | ||
} | ||
@@ -364,3 +363,3 @@ } | ||
sep: '.', | ||
errors: false | ||
errors: true | ||
}; | ||
@@ -367,0 +366,0 @@ |
@@ -225,3 +225,3 @@ (function() { | ||
error = error1; | ||
if (this.cfg.errors === 'throw' || error instanceof E.Intertype_error) { | ||
if (this.cfg.errors || error instanceof E.Intertype_error) { | ||
throw error; | ||
@@ -228,0 +228,0 @@ } |
{ | ||
"name": "intertype", | ||
"version": "10.1.2", | ||
"version": "10.1.3", | ||
"description": "A JavaScript typechecker", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -58,3 +58,3 @@ | ||
Intertype_user_error } = require 'intertype' | ||
types = new Intertype | ||
types = new Intertype { errors: false, } | ||
types.declare.nevah ( x ) -> false | ||
@@ -70,6 +70,5 @@ types.declare.oops ( x ) -> throw new Error 'oops' | ||
Because silently suppressed errors | ||
can be tricky to debug and checking for `state.error` is easily forgotten (and should not normally be | ||
necessary), users may elect to switch off exception-guarding by setting `errors` to `'throw'` (as in, | ||
`types = new Intertype { errors: 'throw', }`) | ||
Because silently suppressed errors can be tricky to debug and checking for `state.error` is easily | ||
forgotten (and should not normally be necessary), exception-guarding is an opt-in (as shown above, use | ||
`errors: false`) | ||
* Users may always construct type testers whose intentional errors will not be silently caught by deriving | ||
@@ -76,0 +75,0 @@ their errors from `Intertype_user_error` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
323686
1840
674