Ticket #292 (new defect)

Opened 1 year ago

Last modified 3 days ago

builtins Array.sort: exception thrown when array contains null or void 0

Reported by: dschaffe Assigned to: lth
Type: defect Priority: major
Milestone: Component: RefImpl
Version: 3.1 Keywords: array
Cc:

Description (last modified by dschaffe) (diff)

Array.sort throws null Reference Error when the array contains a null or void 0 item.

small code example: var A = Array(null,void 0,'a'); var E = A.sort(); print("E="+E);

es4 ri returns: [locn] builtins/Error.es:86:55-86.55 [stack] [init E() | sort() | sort(obj, undefined) | sortEngine(obj, 0, 2, [function Function]) | qsort(0, 2) | qsort(0, 1) | compare(0, 1)] **ERROR** Eval Error: uncaught exception: Reference Error: object reference on null value (near builtins/Error.es:86:55-86.55)

the same code run on tamarin outputs: a , ,

Attachments

Change History

Changed 1 year ago by dschaffe

  • description changed from Array.sort throws null ReferenceError when the array contains a null or void 0 item. small code example: var A = Array(null,void 0,'a'); var E = A.sort(); print("E="+E); es4 ri returns: [locn] builtins/Error.es:86:55-86.55 [stack] [init E() | sort() | sort(obj, undefined) | sortEngine(obj, 0, 2, [function Function]) | qsort(0, 2) | qsort(0, 1) | compare(0, 1)] **ERROR** EvalError: uncaught exception: ReferenceError: object reference on null value (near builtins/Error.es:86:55-86.55) the same code run on tamarin outputs: a,, to Array.sort throws null Reference Error when the array contains a null or void 0 item. small code example: var A = Array(null,void 0,'a'); var E = A.sort(); print("E="+E); es4 ri returns: [locn] builtins/Error.es:86:55-86.55 [stack] [init E() | sort() | sort(obj, undefined) | sortEngine(obj, 0, 2, [function Function]) | qsort(0, 2) | qsort(0, 1) | compare(0, 1)] **ERROR** Eval Error: uncaught exception: Reference Error: object reference on null value (near builtins/Error.es:86:55-86.55) the same code run on tamarin outputs: a , ,

Changed 1 year ago by lth

  • owner set to lth
  • component changed from Proposals to RefImpl

Changed 3 days ago by David-Sarah Hopwood

  • keywords set to array
  • version changed from 4 to 3.1

Affects conformance of RefImpl? to ES3.1.

Note: See TracTickets for help on using tickets.