Permalink
Browse files

Added codegen test to determine if any ancient browsers don't actuall…

…y support it
  • Loading branch information...
dcodeIO committed Dec 18, 2016
1 parent 19e906c commit c234de7f0573ee30ed1ecb15aa82b74c0f994876
Showing with 10 additions and 3 deletions.
  1. +2 −3 src/namespace.js
  2. +8 −0 tests/codegen.js
@@ -283,9 +283,8 @@ NamespacePrototype.lookup = function lookup(path, filterType, parentAlreadyCheck
return this.getRoot().lookup(path.slice(1), filterType);
// Test if the first part matches any nested object, and if so, traverse if path contains more
var found = this.get(path[0]);
if (found && path.length === 1 || found instanceof Namespace && (found = found.lookup(path.slice(1), true)))
if (!filterType || found instanceof filterType)
return found;
if (found && path.length === 1 && (!filterType || found instanceof filterType) || found instanceof Namespace && (found = found.lookup(path.slice(1), filterType, true)))
return found;
// If there hasn't been a match, try again at the parent
if (this.parent === null || parentAlreadyChecked)
return null;
@@ -0,0 +1,8 @@
var tape = require("tape");
var protobuf = require("..");
tape.test("codegen", function(test) {
test.equal(protobuf.util.codegen.supported, true, "should be supported");
test.end();
});

0 comments on commit c234de7

Please sign in to comment.