Skip to content

Commit 19b1933

Browse files
committed
Bug fix: 'property'
1 parent 729422e commit 19b1933

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

dist/easycoder.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,15 +3047,16 @@ const EasyCoder_Core = {
30473047
if (property && propertyContent) {
30483048
if (typeof propertyContent === `object`) {
30493049
content = propertyContent[property];
3050-
} else if ([`{`, `]`].includes(propertyContent.charAt(0))) {
3051-
try {
3052-
content = JSON.parse(propertyContent);
3053-
content = content[property];
3054-
} catch (err) {
3055-
program.runtimeError(program[program.pc].lino, `${err.message}: ${propertyContent}`);
3056-
}
3057-
if (content == undefined) {
3058-
content = ``;
3050+
} else {
3051+
content = ``;
3052+
propertyContent = ``+propertyContent;
3053+
if (propertyContent != `` && [`{`, `]`].includes(propertyContent.charAt(0))) {
3054+
try {
3055+
content = JSON.parse(propertyContent);
3056+
content = content[property];
3057+
} catch (err) {
3058+
program.runtimeError(program[program.pc].lino, `${err.message}: ${propertyContent}`);
3059+
}
30593060
}
30603061
}
30613062
}

js/easycoder/Core.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,15 +3047,16 @@ const EasyCoder_Core = {
30473047
if (property && propertyContent) {
30483048
if (typeof propertyContent === `object`) {
30493049
content = propertyContent[property];
3050-
} else if ([`{`, `]`].includes(propertyContent.charAt(0))) {
3051-
try {
3052-
content = JSON.parse(propertyContent);
3053-
content = content[property];
3054-
} catch (err) {
3055-
program.runtimeError(program[program.pc].lino, `${err.message}: ${propertyContent}`);
3056-
}
3057-
if (content == undefined) {
3058-
content = ``;
3050+
} else {
3051+
content = ``;
3052+
propertyContent = ``+propertyContent;
3053+
if (propertyContent != `` && [`{`, `]`].includes(propertyContent.charAt(0))) {
3054+
try {
3055+
content = JSON.parse(propertyContent);
3056+
content = content[property];
3057+
} catch (err) {
3058+
program.runtimeError(program[program.pc].lino, `${err.message}: ${propertyContent}`);
3059+
}
30593060
}
30603061
}
30613062
}

0 commit comments

Comments
 (0)