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

Make String#substr more discoverable #3877

Open
sevenc-nanashi opened this issue Jun 16, 2024 · 4 comments
Open

Make String#substr more discoverable #3877

sevenc-nanashi opened this issue Jun 16, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@sevenc-nanashi
Copy link

ECMASCript feature
Explain the ECMAScript feature that you'd like to see implemented.

String.prototype.substr (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr). It's deprecated, but it is still used in many libraries.

Example code
Give a code example that should work after the implementation of this feature.

const str = 'Mozilla';

console.log(str.substr(1, 2));
// Expected output: "oz"

console.log(str.substr(2));
// Expected output: "zilla"
@sevenc-nanashi sevenc-nanashi added the enhancement New feature or request label Jun 16, 2024
@jedel1043
Copy link
Member

Already implemented, just gated behind the annex-b feature.

boa_engine = { version = "0.18.0", features = ["annex-b"] }

@sevenc-nanashi
Copy link
Author

Oh, thanks!

@jedel1043
Copy link
Member

I'll keep this issue open though, since it seems that we need to have better discoverability for that specific feature; "annex-b" is not as well known for people without spec expertise.

@jedel1043 jedel1043 reopened this Jun 16, 2024
@jedel1043 jedel1043 changed the title String#substr? Make String#substr more discoverable Jun 16, 2024
@nekevss
Copy link
Member

nekevss commented Jul 7, 2024

Maybe, we can add this as a page on the website? Something akin to feature flags, and the features that are behind each flag?

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

No branches or pull requests

3 participants