Inherited splice doesn't call delete

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: tomasz, Assigned: Paul Biggar)

Tracking

5 Branch
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: js-triage-done)

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0
Build ID: 20110615151330

Steps to reproduce:

Hi,

whilst creating a specific list for my purposes I encountered a problem. I stripped everything and my final reproduction code looks like:

function NPList(){
	
}
NPList.prototype = new Array;

list = new NPList();

list.push('a');

list.splice(0, 1);

alert(list.length + ' ' + list[0]);

Which I believe should not happen.


Actual results:

0 'a'


Expected results:

0 undefined
Whiteboard: js-triage-needed
(Assignee)

Comment 1

6 years ago
I'm rewriting the splice code in bug 668024, so I'll look at this one.
Assignee: general → pbiggar
(Assignee)

Comment 2

6 years ago
This is a bug, expected results are exactly as Tomasz says. The good news is that that's the result my rewrite gives, so this will be fixed by bug 668024.

Thanks for the report and the minimized test case Tomasz!
Depends on: 668024
Whiteboard: js-triage-needed → js-triage-done
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.