APAR status
Closed as program error.
Error description
Title: TDI implementation of the splice method is inconsistent with the ECMAScript specification. Description: The implementation TDI uses makes splice return the original array without the deleted element. This is significantly different than what stands in the specification. There is a difference between the ECMAScript specification for the method "splice" for arrays. Section 15.4.4.12 of the http://www.ecmascript.org/docs/tc39-2009-043.pdf details the specification. Steps to Duplicate: Create an Assemblyline with an EmptyScript. Paste the script below in the EmptyScript component, and run the Assemblyline. The results will not match the definition of the .splice method. var myFish = ["angel", "clown", "mandarin", "surgeon"]; task.logmsg(">> TEST 1"); //removes 0 elements from index 2, and inserts "drum" var removed = myFish.splice(2, 0, "drum"); task.logmsg("removed = " +removed); task.logmsg("myFish = " +myFish); //myFish is ["angel", "clown", "drum", "mandarin", "surgeon"] //removed is [], no elements removed task.logmsg("------"); task.logmsg(">> TEST 2"); //removes 1 element from index 3 removed = myFish.splice(3, 1); task.logmsg("removed = " +removed); task.logmsg("myFish = " +myFish); //myFish is ["angel", "clown", "drum", "surgeon"] //removed is ["mandarin"] task.logmsg("------"); task.logmsg(">> TEST 3"); //removes 1 element from index 2, and inserts "trumpet" removed = myFish.splice(2, 1, "trumpet"); task.logmsg("removed = " +removed); task.logmsg("myFish = " +myFish); //myFish is ["angel", "clown", "trumpet", "surgeon"] //removed is ["drum"] task.logmsg("------"); task.logmsg(">> TEST 4"); //removes 2 elements from index 0, and inserts "parrot", "anemone" and "blue" removed = myFish.splice(0, 2, "parrot", "anemone", "blue"); task.logmsg("removed = " +removed); task.logmsg("myFish = " +myFish); //myFish is ["parrot", "anemone", "blue", "trumpet", "surgeon"] //removed is ["angel", "clown"] task.logmsg("------"); Desired Behavior: As noted in the test script above, the .splice method should return the items removed from the array. Environment: 7.1.1
Local fix
1787
Problem summary
TDI implementation of the splice method should be consisitent with the ECMA Script specifications.
Problem conclusion
This is a bug in the TDI code and has been fixed. The official fix will be made available in 7.1.1-TIV-TDI-FP0003.
Temporary fix
Comments
APAR Information
APAR number
IO18141
Reported component name
ITDI MULTIPLATF
Reported component ID
5724D9960
Reported release
711
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-02-13
Closed date
2013-02-27
Last modified date
2013-02-27
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
ITDI MULTIPLATF
Fixed component ID
5724D9960
Applicable component levels
R711 PSY
UP
Rate this page:
Average rating
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.