-
Bug
-
Resolution: Fixed
-
P4
-
9
-
None
-
b107
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8163780 | 8u121 | Michael Haupt | P4 | Resolved | Fixed | b01 |
JDK-8157919 | 8u112 | Michael Haupt | P4 | Resolved | Fixed | b01 |
JDK-8167947 | emb-8u121 | Unassigned | P4 | Resolved | Fixed | b01 |
Functions defined at JS level and functions defined as an AbstractJSObject are passed arguments differently when invoked through Function.prototype.apply.call(): the AbstractJSObject implementation will be passed an Object[] containing an Object[] holding all the arguments, whereas the JS function will be passed an array containing the arguments (not nested in an extra array).
The attached test case produces the following output:
args = [1, 2, 3]
args = [[1, 2, 3]] // note this line
1
2
3
1
2
3
Expected:
args = [1, 2, 3]
args = [1, 2, 3] // this differs from above
1
2
3
1
2
3
The attached test case produces the following output:
args = [1, 2, 3]
args = [[1, 2, 3]] // note this line
1
2
3
1
2
3
Expected:
args = [1, 2, 3]
args = [1, 2, 3] // this differs from above
1
2
3
1
2
3
- backported by
-
JDK-8157919 arguments are handled differently in apply for JS functions and AbstractJSObjects
- Resolved
-
JDK-8163780 arguments are handled differently in apply for JS functions and AbstractJSObjects
- Resolved
-
JDK-8167947 arguments are handled differently in apply for JS functions and AbstractJSObjects
- Resolved
- relates to
-
JDK-8150814 correct package declaration in Nashorn test
- Resolved
-
JDK-8148134 AbstractJSObject function does not support "apply()"
- Closed