6.7.0 - Alpha11 - 修复 notice 方法参数数量及类型限制错误 (issue #462)

This commit is contained in:
SuperMonster003
2025-11-10 14:33:41 +08:00
parent 6186754327
commit 1612838c4a
3 changed files with 8 additions and 7 deletions

View File

@@ -62,7 +62,7 @@ class Notice(private val scriptRuntime: ScriptRuntime) : Augmentable(scriptRunti
require(argList.size <= 2) {
"Arguments length ${argList.size} shouldn't be greater than 2 for notice with builder"
}
require(argList.size <= 1 && (arg1.isJsNullish() || arg1 is NativeObject)) {
require(arg1.isJsNullish() || arg1 is NativeObject) {
"Argument options ${arg1.jsBrief()} must be a JavaScript Object for notice with builder"
}
@@ -106,7 +106,7 @@ class Notice(private val scriptRuntime: ScriptRuntime) : Augmentable(scriptRunti
require(argList.size <= 2) {
"Arguments length ${argList.size} shouldn't be greater than 2 for notice with content"
}
require(argList.size <= 1 && (arg1.isJsNullish() || arg1 is NativeObject)) {
require(arg1.isJsNullish() || arg1 is NativeObject) {
"Argument options ${arg1.jsBrief()} must be a JavaScript Object for notice with content"
}
@@ -126,7 +126,7 @@ class Notice(private val scriptRuntime: ScriptRuntime) : Augmentable(scriptRunti
require(argList.size <= 3) {
"Arguments length ${argList.size} shouldn't be greater than 3 for notice with title and content"
}
require(argList.size <= 2 && (arg2.isJsNullish() || arg2 is NativeObject)) {
require(arg2.isJsNullish() || arg2 is NativeObject) {
"Argument options ${arg2.jsBrief()} must be a JavaScript Object for notice with title and content"
}