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

Add new native object properties and functions #1330

Merged
merged 3 commits into from
Jan 12, 2023
Merged
Changes from 1 commit
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
24 changes: 24 additions & 0 deletions lib/compress/native-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const object_methods = [

export const is_pure_native_method = make_nested_lookup({
Array: [
"at",
"flat",
fabiosantoscode marked this conversation as resolved.
Show resolved Hide resolved
"indexOf",
"join",
"lastIndexOf",
Expand All @@ -99,22 +101,41 @@ export const is_pure_native_method = make_nested_lookup({
...object_methods,
],
String: [
"at",
"charAt",
"charCodeAt",
"charPointAt",
"concat",
"endsWith",
"fromCharCode",
"fromCodePoint",
"includes",
"indexOf",
"italics",
"lastIndexOf",
"localeCompare",
"match",
"matchAll",
"normalize",
"padStart",
"padEnd",
"repeat",
"replace",
"replaceAll",
"search",
"slice",
"split",
"startsWith",
"substr",
"substring",
"repeat",
"toLocaleLowerCase",
"toLocaleUpperCase",
"toLowerCase",
"toUpperCase",
"trim",
"trimEnd",
"trimStart",
...object_methods,
],
});
Expand Down Expand Up @@ -174,6 +195,9 @@ export const is_pure_native_value = make_nested_lookup({
"SQRT1_2",
"SQRT2",
],
String: [
"raw",
],
fabiosantoscode marked this conversation as resolved.
Show resolved Hide resolved
Number: [
"MAX_VALUE",
"MIN_VALUE",
Expand Down