Permalink
Browse files

Merge pull request #240 from gyandeeps/master

Fix: Remove `inherit` and use Object.create for inheritance (fixes #239)
  • Loading branch information...
2 parents df57eb5 + 6bf7c65 commit 05799a3679e3bdd714017f4b6a5f23b5926d0478 @puzrin puzrin committed Jan 11, 2016
Showing with 4 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +2 −5 lib/js-yaml/exception.js
  3. +1 −2 package.json
View
@@ -4,3 +4,4 @@ node_modules
doc
benchmark/implementations/*
!/benchmark/implementations/current/
+.idea
@@ -2,10 +2,6 @@
//
'use strict';
-
-var inherits = require('inherit');
-
-
function YAMLException(reason, mark) {
// Super constructor
Error.call(this);
@@ -27,7 +23,8 @@ function YAMLException(reason, mark) {
// Inherit from Error
-inherits(YAMLException, Error);
+YAMLException.prototype = Object.create(Error.prototype);
+YAMLException.prototype.constructor = YAMLException;
YAMLException.prototype.toString = function toString(compact) {
View
@@ -28,8 +28,7 @@
},
"dependencies": {
"argparse": "^1.0.2",
- "esprima": "^2.6.0",
- "inherit": "^2.2.2"
+ "esprima": "^2.6.0"
},
"devDependencies": {
"ansi": "*",

0 comments on commit 05799a3

Please sign in to comment.