javascript 0.1.13

A JavaScript engine implementation in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function MyError(message) {
  this.message = message || "";
}

MyError.prototype.toString = function() { return "MyError: " + this.message; };

try {
  throw new MyError('dbg-test');
} catch(e) {
  console.log('CAUGHT constructor==', e.constructor===MyError);
  console.log('CAUGHT constructor.name =', e.constructor && e.constructor.name);
  console.log('CAUGHT message =', e.message);
  console.log('CAUGHT toString =', e.toString());
}

(function(){
    console.log('msg', "OK");
})()