Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parse.js "parent.add(oneof)“ error #1602

Merged
merged 1 commit into from Apr 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/namespace.js
Expand Up @@ -6,6 +6,7 @@ var ReflectionObject = require("./object");
((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace";

var Field = require("./field"),
OneOf = require("./oneof"),
util = require("./util");

var Type, // cyclic
Expand Down Expand Up @@ -217,7 +218,7 @@ Namespace.prototype.getEnum = function getEnum(name) {
*/
Namespace.prototype.add = function add(object) {

if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))
if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace || object instanceof OneOf))
throw TypeError("object must be a valid nested object");

if (!this.nested)
Expand Down