Skip to content

Commit e086b5e

Browse files
committed
merge
2 parents d06ea6e + 0b6e613 commit e086b5e

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

flowchart-latest.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// flowchart, v1.1.2
1+
// flowchart, v1.1.3
22
// Copyright (c)2013 Adriano Raiano (adrai).
33
// Distributed under MIT license
44
// http://adrai.github.io/flowchart.js
@@ -111,15 +111,25 @@
111111
}
112112

113113
function _inherits(ctor, superCtor) {
114-
ctor.super_ = superCtor;
115-
ctor.prototype = Object.create(superCtor.prototype, {
116-
constructor: {
117-
value: ctor,
118-
enumerable: false,
119-
writable: true,
120-
configurable: true
121-
}
122-
});
114+
if (typeof(Object.create) === 'function') {
115+
// implementation from standard node.js 'util' module
116+
ctor.super_ = superCtor;
117+
ctor.prototype = Object.create(superCtor.prototype, {
118+
constructor: {
119+
value: ctor,
120+
enumerable: false,
121+
writable: true,
122+
configurable: true
123+
}
124+
});
125+
} else {
126+
// old school shim for old browsers
127+
ctor.super_ = superCtor;
128+
var TempCtor = function () {};
129+
TempCtor.prototype = superCtor.prototype;
130+
ctor.prototype = new TempCtor();
131+
ctor.prototype.constructor = ctor;
132+
}
123133
}
124134

125135
// move dependent functions to a container so that

0 commit comments

Comments
 (0)