Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "java-slang",
"version": "1.0.13",
"version": "1.0.14",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": ["dist"],
Expand All @@ -14,7 +14,7 @@
"test": "jest",
"test:watch": "jest --watch",
"jsdoc": "typedoc --plugin typedoc-plugin-rename-defaults",
"eslint": "eslint --ext \".ts\" src",
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint --ext \".ts\" src",
Comment thread
kjw142857 marked this conversation as resolved.
"format": "prettier --write src/**/*.ts",
"prepare": "husky"
},
Expand Down
14 changes: 7 additions & 7 deletions src/compiler/code-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ const codeGenerators: { [type: string]: (node: Node, cg: CodeGenerator) => Compi
},

CastExpression: (node: Node, cg: CodeGenerator) => {
const { castType: ct, expression: expr, isPrimitiveCast: b } = node as CastExpression
const { castType: ct, expression: expr, isPrimitiveCast: b } = node as CastExpression
if (b) {
const res = compile(expr, cg)
const { stackSize: size, resultType: rt } = res
Expand All @@ -539,7 +539,7 @@ const codeGenerators: { [type: string]: (node: Node, cg: CodeGenerator) => Compi
}
return { stackSize: Math.max(size, 2), resultType: 'D' }
case 'float':
switch(rt) {
switch (rt) {
case 'D':
cg.code.push(OPCODE.D2F)
break
Expand All @@ -553,7 +553,7 @@ const codeGenerators: { [type: string]: (node: Node, cg: CodeGenerator) => Compi
}
return { stackSize: Math.max(size, 1), resultType: 'F' }
case 'long':
switch(rt) {
switch (rt) {
case 'D':
cg.code.push(OPCODE.D2L)
break
Expand Down Expand Up @@ -584,10 +584,10 @@ const codeGenerators: { [type: string]: (node: Node, cg: CodeGenerator) => Compi
return { stackSize: Math.max(size, 1), resultType: 'I' }
}
}
const res = compile(expr, cg);
const classInfoIndex = cg.constantPoolManager.indexClassInfo(ct as string);
cg.code.push(OPCODE.CHECKCAST, 0, classInfoIndex);
return res;
const res = compile(expr, cg)
const classInfoIndex = cg.constantPoolManager.indexClassInfo(ct)
cg.code.push(OPCODE.CHECKCAST, 0, classInfoIndex)
Comment thread
kjw142857 marked this conversation as resolved.
return res
},

ClassInstanceCreationExpression: (node: Node, cg: CodeGenerator) => {
Expand Down
Loading