Skip to content

Commit

Permalink
Fix errors related to object prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
pratid committed Nov 11, 2016
1 parent 5d79926 commit 8e21665
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ngsi_adapter/lib/parsers/common/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function getParserByName(name) {
try {
/* jshint proto: true, camelcase: false */
var prototype = require(path.join(dir, util.format('%s.js', name))).parser;
if (prototype.__proto__ === null) {
prototype.__proto__ = baseParser; // ensure baseParser is part of the prototype chain
if (Object.getPrototypeOf(prototype) === null) {
Object.setPrototypeOf(prototype, baseParser); // ensure baseParser is part of the prototype chain
}
parser = Object.create(prototype);
parsersCache[name] = parser;
Expand Down

0 comments on commit 8e21665

Please sign in to comment.