From b5ca06113671e57c5c973c4a7d3e71b88914ff1d Mon Sep 17 00:00:00 2001 From: K35 Date: Tue, 18 Jan 2022 10:29:24 +0000 Subject: [PATCH] Fiying bug --- lib/jrpc.js | 2 +- package.json | 2 +- src/ir.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jrpc.js b/lib/jrpc.js index 8fa71eb..3b42786 100755 --- a/lib/jrpc.js +++ b/lib/jrpc.js @@ -9905,7 +9905,7 @@ function get_ir(parsed) { throw new IRError(field, "Invalid statement!"); } if (defined.indexOf(field.fieldtype) < 0) { - if (builtin.indexOf(field.fieldtype) < 0 && field.fieldtype !== field.name) { + if (builtin.indexOf(field.fieldtype) < 0 && field.fieldtype !== statement.name) { throw new IRError(field, `Type ${field.fieldtype} is not defined!`); } } else { diff --git a/package.json b/package.json index 6c116e3..0bcd93d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hibas123/jrpcgen", - "version": "1.0.25", + "version": "1.0.26", "main": "lib/index.js", "license": "MIT", "packageManager": "yarn@3.1.1", diff --git a/src/ir.ts b/src/ir.ts index 72fe9bb..dd78008 100644 --- a/src/ir.ts +++ b/src/ir.ts @@ -101,7 +101,7 @@ export default function get_ir(parsed: Parsed): IR { } if (defined.indexOf(field.fieldtype) < 0) { - if (builtin.indexOf(field.fieldtype) < 0 && field.fieldtype !== field.name) { + if (builtin.indexOf(field.fieldtype) < 0 && field.fieldtype !== statement.name) { throw new IRError( field, `Type ${field.fieldtype} is not defined!`