Skip to content
Open
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 src/extensions/jwArray/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class ArrayType {
case "object":
if (x === null) return "null"
if (typeof x.jwArrayHandler == "function") {
return x.jwArrayHandler()
return x.jwArrayHandler(false, "array")
}
return "Object"
case "undefined":
Expand All @@ -114,7 +114,7 @@ class ArrayType {
return "?"
}

jwArrayHandler() {
jwArrayHandler(expectsPlainString, context) {
return `Array<${formatNumber(this.array.length)}>`
}

Expand Down
4 changes: 3 additions & 1 deletion src/extensions/jwColor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ class ColorType {
return this.fromRGB(r, g, b)
}

jwArrayHandler() {
jwArrayHandler(expectsPlainString, context) {
if (expectsPlainString) return this.toString()

let color = document.createElement('div')
color.style.width = "16px"
color.style.height = "16px"
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/jwDate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DateType {
return new DateType()
}

jwArrayHandler() {
jwArrayHandler(expectsPlainString, context) {
return this.date.toLocaleDateString()
}

Expand Down
2 changes: 1 addition & 1 deletion src/extensions/jwLambda/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class LambdaType {
return new LambdaType()
}

jwArrayHandler() {
jwArrayHandler(expectsPlainString, context) {
return 'Lambda'
}

Expand Down
2 changes: 1 addition & 1 deletion src/extensions/jwNum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class NumType {
return new NumType(x)
}

jwArrayHandler() {
jwArrayHandler(expectsPlainString, context) {
return this.number.toStringWithDecimalPlaces(3)
}

Expand Down
3 changes: 2 additions & 1 deletion src/extensions/jwTargets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class jwTargetType {
return new jwTargetType("")
}

jwArrayHandler() {
jwArrayHandler(expectsPlainString, context) {
// always a string
try {
return escapeHTML(`Target<${this.target.sprite.name}>`)
} catch {
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/jwVector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class VectorType {
return new VectorType(0, 0)
}

jwArrayHandler() {
jwArrayHandler(expectsPlainString, context) {
return 'Vector'
}

Expand Down
4 changes: 2 additions & 2 deletions src/extensions/jwXML/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class XMLType {
].reduce((a, b) => a.replaceAll(b, ""), text)
}

jwArrayHandler() {
return XMLType.safeText(`<${this.name} />`)
jwArrayHandler(expectsPlainString, context) {
return XMLType.safeText(`<${this.name} />`) // always a string
}

toString(pretty = false, depth = 0) {
Expand Down