Skip to content

jakub-zawislak/reasonml-exception-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReasonML uncaught exception demo

StackOverflow question

I have created this boilerplate using bsb -init -theme react-hooks and then I have removed the react-related code.

Run

npm install
npm run server
# in a new tab
npm start

Open a new web page to http://localhost:8000/.

Issue

If running in a browser there is an uncaught Failure exception.

In index.bs.js there is a comparison:

exn[0] === Caml_builtin_exceptions.failure

Both exn[0] and Caml_builtin_exceptions.failure are ["Failure", -2, tag: 248], but the comparison of these doesn't return true.

console.log(exn[0])                                     // ["Failure", -2, tag: 248]
console.log(Caml_builtin_exceptions.failure)            // ["Failure", -2, tag: 248]
console.log(exn[0] === Caml_builtin_exceptions.failure) // false

There is no problem with running from command line:

node src/index.bs.js

About

ReasonML uncaught exception demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published