pref: allow anonymous function in asswmbly.
This commit is contained in:
parent
618b6d653a
commit
1ef8238a00
|
@ -59,9 +59,12 @@ export class NonameAssembly extends Array {
|
|||
name = content.name
|
||||
}
|
||||
if (typeof content !== "function") throw new Error("you can't add a non-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) throw new Error("you can't add a anonymous function to assembly.")
|
||||
|
||||
if (!this.has(name)) {
|
||||
if (typeof name !== "string" || name.length === 0) {
|
||||
Array.prototype.add.call(this, content)
|
||||
}
|
||||
else if (!this.has(name)) {
|
||||
this.#record.set(name, this.length)
|
||||
Array.prototype.push.call(this, content)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue