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

Issue#412 #418

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Issue#412 #418

wants to merge 1 commit into from

Conversation

YLeight
Copy link

@YLeight YLeight commented Nov 24, 2016

@ljharb I have added two tests which show thin places of both decisions in FF versions > 34 (current one and my previous one) from line 39 on
My current solution is a littlle bit difficult, but I have not found more simple one yet.

@ljharb ljharb force-pushed the issue#412 branch 2 times, most recently from 54e30ea to e44022d Compare January 7, 2020 07:24
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YLeight sorry for the long delay here.

I've rebased this and cleaned up a number of lint violations. However, there's still some left, plus some additional comments.

es5-shim.js Outdated
}

if (result[groupIndex] && !result[groupIndex].isResulting) {
result.splice(groupIndex, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should definitely not rely on:

  • splice working properly
  • splice being present

nor should we mutate the array like this.

es5-shim.js Outdated
searchValue.lastIndex = originalLastIndex; // eslint-disable-line no-param-reassign
pushCall(args, arguments[length - 2], arguments[length - 1]);
return replaceValue.apply(this, args);
var groups = ArrayPrototype.slice.call(arguments, 1, -2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete Array.prototype.slice would break this code.

Suggested change
var groups = ArrayPrototype.slice.call(arguments, 1, -2);
var groups = arraySlice(arguments, 1, -2);

for (var i = 0; i < groups.length; i++) {
var argumentIndex = i + 1;
if (groups[i] === '' && extendedGroups[i].mayBeMissing) {
arguments[argumentIndex] = undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assigning to arguments is a massive deoptimization, and is mutation anyways. we'll have to avoid this.

es5-shim.js Outdated
}
}

return replaceValue.apply(this, arguments);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return replaceValue.apply(this, arguments);
return apply.call(replaceValue, this, arguments);

@ljharb
Copy link
Member

ljharb commented Mar 22, 2020

ping @YLeight; i've rebased this, but there's still linting issues as well as mutation.

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 this pull request may close these issues.

2 participants