Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array_multisort throws "Unable to delete property." #344

Open
oleg-andreyev opened this issue Aug 17, 2017 · 4 comments · May be fixed by #472
Open

array_multisort throws "Unable to delete property." #344

oleg-andreyev opened this issue Aug 17, 2017 · 4 comments · May be fixed by #472

Comments

@oleg-andreyev
Copy link

oleg-andreyev commented Aug 17, 2017

Browser: PhantomJS
Code:

'use strict`
array_multisort(["productIds[]", "_"], 'SORT_ASC', ["productIds[]=977385529", "_=1502965788347"])

Error: array_multisort.js:171 Unable to delete property.
delete sortKeys[i]

Ref.: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode

Third, strict mode makes attempts to delete undeletable properties throw (where before the attempt would simply have no effect):

'use strict';
delete Object.prototype; // throws a TypeError
@oleg-andreyev
Copy link
Author

after creating sortArrs[0], we're creating sortArrs[2] instead of sortArrs[1], and because sequences is broken (not 0,1,2...) sortArrs.length will be 3, instead of 2

oleg-andreyev added a commit to oleg-andreyev/locutus that referenced this issue Aug 22, 2017
oleg-andreyev added a commit to oleg-andreyev/locutus that referenced this issue Aug 22, 2017
kvz pushed a commit that referenced this issue Aug 24, 2017
@oleg-andreyev
Copy link
Author

We've found another issue but under Edge:

Calling delete on '0' is not allowed in strict mode

Near this line:

if (arguments[i].hasOwnProperty(k)) {
                                delete arguments[i][k];
                            }

Copy link

github-actions bot commented Apr 5, 2024

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@kvz kvz linked a pull request Apr 5, 2024 that will close this issue
@kvz
Copy link
Collaborator

kvz commented Apr 5, 2024

Attempting something here: #472

No promises :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants