Skip to content

Commit

Permalink
Merge branch 'v2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Samchon committed Dec 20, 2018
2 parents d574906 + a1ea6d5 commit fd32056
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -6,7 +6,7 @@
"email": "samchon@samchon.org",
"url": "http://samchon.org"
},
"version": "2.1.0",
"version": "2.1.1",
"main": "./index.js",
"typings": "./index.d.ts",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions src/exception/Exception.ts
Expand Up @@ -26,6 +26,13 @@ export class Exception extends Error
public constructor(message: string = "")
{
super(message);

// INHERITANCE POLYFILL
let proto = new.target.prototype;
if (Object.setPrototypeOf)
Object.setPrototypeOf(this, proto);
else
(this as any).__proto__ = proto;
}

/* ---------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion src/exception/SystemError.ts
Expand Up @@ -42,16 +42,18 @@ export class SystemError extends RuntimeError
{
super("");

if (args.length >= 2 && typeof args[0] === "number")
if (args.length >= 2 && typeof args[0].valueOf() === "number")
{
let val: number = args[0];
let category: ErrorCategory = args[1];

this.code_ = new ErrorCode(val, category);
this.message = args[2];
}
else
{
this.code_ = args[0];
this.message = args[1];
}
}

Expand Down

0 comments on commit fd32056

Please sign in to comment.