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

Substr length should not have a default #5757

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Substr length should not have a default #5757

wants to merge 2 commits into from

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan requested review from darzu, mmoskal, riknoll and shakao July 16, 2019 14:20
Copy link
Member

@mmoskal mmoskal left a comment

Choose a reason for hiding this comment

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

I think this requires changes to cpp?

@@ -244,7 +244,7 @@ declare interface String {
* @param start first character index; can be negative from counting from the end, eg:0
* @param length number of characters to extract
*/
//% shim=String_::substr length.defl=10
//% shim=String_::substr
//% help=text/substr
//% blockId="string_substr" block="substring of %this=text|from %start|of length %length" blockNamespace="text"
substr(start: number, length?: number): string;
Copy link
Contributor

Choose a reason for hiding this comment

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

don't you want to change this param to be non-optional?

Copy link
Contributor

@darzu darzu left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

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.

3 participants