Skip to content

Commit

Permalink
Properly resolve extend references, fixes #103
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Feb 11, 2014
1 parent 36e5cc8 commit 7777b3c
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions ProtoBuf.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @const
* @expose
*/
ProtoBuf.VERSION = "2.0.4";
ProtoBuf.VERSION = "2.0.5";

/**
* Wire types.
Expand Down Expand Up @@ -3242,7 +3242,7 @@
this.ptr.addChild(obj);
obj = null;
} else if (Builder.isValidExtend(def)) {
obj = this.lookup(def["ref"]);
obj = this.ptr.resolve(def["ref"]);
if (obj) {
for (i=0; i<def["fields"].length; i++) { // i=Fields
if (obj.hasChild(def['fields'][i]['id'])) {
Expand Down
4 changes: 2 additions & 2 deletions ProtoBuf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ProtoBuf.min.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ProtoBuf.noparse.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @const
* @expose
*/
ProtoBuf.VERSION = "2.0.4";
ProtoBuf.VERSION = "2.0.5";

/**
* Wire types.
Expand Down Expand Up @@ -2342,7 +2342,7 @@
this.ptr.addChild(obj);
obj = null;
} else if (Builder.isValidExtend(def)) {
obj = this.lookup(def["ref"]);
obj = this.ptr.resolve(def["ref"]);
if (obj) {
for (i=0; i<def["fields"].length; i++) { // i=Fields
if (obj.hasChild(def['fields'][i]['id'])) {
Expand Down
4 changes: 2 additions & 2 deletions ProtoBuf.noparse.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ProtoBuf.noparse.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "protobuf",
"description": "Protocol Buffers for JavaScript. Finally.",
"version": "2.0.4",
"version": "2.0.5",
"main": "ProtoBuf.js",
"license": "Apache-2.0",
"homepage": "http://dcode.io/",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "protobufjs",
"version": "2.0.4",
"version": "2.0.5",
"description": "A full-featured protobuf implementation in plain JavaScript.",
"author": "Daniel Wirtz <dcode@dcode.io>",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion src/ProtoBuf/Builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {
this.ptr.addChild(obj);
obj = null;
} else if (Builder.isValidExtend(def)) {
obj = this.lookup(def["ref"]);
obj = this.ptr.resolve(def["ref"]);
if (obj) {
for (i=0; i<def["fields"].length; i++) { // i=Fields
if (obj.hasChild(def['fields'][i]['id'])) {
Expand Down

0 comments on commit 7777b3c

Please sign in to comment.