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

Move Array#fill to "write then read" methods so the template correctly updates #408

Merged
merged 3 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon/src/-private/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const ARRAY_GETTER_METHODS = new Set<string | symbol | number>([
'concat',
'entries',
'every',
'fill',
'filter',
'find',
'findIndex',
Expand All @@ -41,6 +40,7 @@ const ARRAY_GETTER_METHODS = new Set<string | symbol | number>([
// For these methods, `Array` itself immediately gets the `.length` to return
// after invoking them.
const ARRAY_WRITE_THEN_READ_METHODS = new Set<string | symbol>([
'fill',
'push',
'unshift',
]);
Expand Down
2 changes: 1 addition & 1 deletion test-app/tests/unit/array-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const ARRAY_GETTER_METHODS = [
'concat',
'entries',
'every',
'fill',
'filter',
'find',
'findIndex',
Expand All @@ -36,6 +35,7 @@ const ARRAY_GETTER_METHODS = [

const ARRAY_SETTER_METHODS = [
'copyWithin',
'fill',
'pop',
'push',
'reverse',
Expand Down