fix: recursion.

This commit is contained in:
Rintim 2024-03-21 13:18:40 +08:00
parent dd3b1b0d74
commit 2b7ba01fd2
No known key found for this signature in database
GPG Key ID: BE9E1EA615BACFCF
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ export class NonameAssembly extends Array {
// if (typeof name !== "string" || name.length === 0) throw new Error("you can't add a anonymous function to assembly.") // if (typeof name !== "string" || name.length === 0) throw new Error("you can't add a anonymous function to assembly.")
if (typeof name !== "string" || name.length === 0) { if (typeof name !== "string" || name.length === 0) {
Array.prototype.add.call(this, content) if (!this.includes(content)) Array.prototype.push.call(this, content)
} }
else if (!this.has(name)) { else if (!this.has(name)) {
this.#record.set(name, this.length) this.#record.set(name, this.length)