@@ -32,8 +32,8 @@ import Language.PureScript.CoreImp.Optimizer
3232import Language.PureScript.CoreFn
3333import Language.PureScript.Crash
3434import Language.PureScript.Errors (ErrorMessageHint (.. ), SimpleErrorMessage (.. ),
35- MultipleErrors (.. ), rethrow ,
36- errorMessage , rethrowWithPosition , addHint )
35+ MultipleErrors (.. ), rethrow , errorMessage ,
36+ errorMessage' , rethrowWithPosition , addHint )
3737import Language.PureScript.Names
3838import Language.PureScript.Options
3939import Language.PureScript.PSString (PSString , mkString )
@@ -423,10 +423,10 @@ moduleToJs (Module coms mn _ imps exps foreigns decls) foreign_ =
423423 -- the value is `Unary Negate (NumericLiteral (Left 2147483648))`, and
424424 -- 2147483648 is larger than the maximum allowed int.
425425 return $ AST. NumericLiteral ss (Left (- i))
426- go js@ (AST. NumericLiteral _ (Left i)) =
426+ go js@ (AST. NumericLiteral ss (Left i)) =
427427 let minInt = - 2147483648
428428 maxInt = 2147483647
429429 in if i < minInt || i > maxInt
430- then throwError . errorMessage $ IntOutOfRange i " JavaScript" minInt maxInt
430+ then throwError . maybe errorMessage errorMessage' ss $ IntOutOfRange i " JavaScript" minInt maxInt
431431 else return js
432432 go other = return other
0 commit comments