Skip to content

Commit e8a39ab

Browse files
committed
feat(Project): update version to v0.1.1-SNAPSHOT
1 parent 4010fc5 commit e8a39ab

File tree

1 file changed

+5
-5
lines changed
  • src/main/kotlin/com/github/zimolab/jsarray/base

1 file changed

+5
-5
lines changed

src/main/kotlin/com/github/zimolab/jsarray/base/JsArray.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private constructor(override val reference: JSObject) : JsArrayInterface<T> {
129129
private fun <R> with(
130130
nameInJs: String,
131131
callback: JsArraySortFunction<R>,
132-
execution: (method: String) -> Any?
132+
execution: (callbackName: String) -> Any?
133133
): Any? {
134134
reference.inject(nameInJs, callback)
135135
val result = execution("this.${nameInJs}.compare")
@@ -434,12 +434,12 @@ private constructor(override val reference: JSObject) : JsArrayInterface<T> {
434434
}
435435

436436
override fun reduceRight(callback: JsArrayIteratorCallback<T?, T?>): T? {
437-
val result = this.with("__reduce_cb__", callback) { method ->
437+
val result = this.with("__reduce_cb__", callback) { callback_ ->
438438
// BugFix #1
439439
execute(
440440
"{" +
441441
"let __tmp=this.$REDUCE_RIGHT((total, item, index, arr)=>{ " +
442-
"return $method(${undefine2Null("item")}, index, ${undefine2Null("total")}, arr) });" +
442+
"return $callback_(${undefine2Null("item")}, index, ${undefine2Null("total")}, arr) });" +
443443
"__tmp==$UNDEFINED?null:__tmp;" +
444444
"}"
445445
)
@@ -451,9 +451,9 @@ private constructor(override val reference: JSObject) : JsArrayInterface<T> {
451451
val result = if (sortFunction == null)
452452
invoke(SORT)
453453
else {
454-
this.with("__sort_cb__", sortFunction) { method ->
454+
this.with("__sort_cb__", sortFunction) { sortFunc_ ->
455455
// BugFix #1
456-
execute("this.$SORT((a, b)=>{ return $method(${undefine2Null("a")}, ${undefine2Null("b")}) });")
456+
execute("this.$SORT((a, b)=>{ return $sortFunc_(${undefine2Null("a")}, ${undefine2Null("b")}) });")
457457
}
458458
}
459459
if (result is JSObject)

0 commit comments

Comments
 (0)