Skip to content

Dart semantics depends on newline encoding #23888

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

Closed
johnniwinther opened this issue Jul 22, 2015 · 3 comments
Closed

Dart semantics depends on newline encoding #23888

johnniwinther opened this issue Jul 22, 2015 · 3 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report

Comments

@johnniwinther
Copy link
Member

johnniwinther commented Jul 22, 2015

The specification of multiline string is underspecified wrt. the semantics of a newlines.

This introduces the risk that the Dart semantics depends on newline encodings and thus changes upon checkout if the revision system normalizes newline encodings, as is now the case for our own dart-lang/sdk repository.

The VM normalizes occurrences of '\n', '\r', and '\r\n' to a '\n' within a multiline string—which is the preferred behavior since it removes the semantic instability.
The analyzer and dart2js takes '\n', '\r' and '\r\n' verbatim thus making them semantics vulnerable to newline encodings. See the tests in tests/language/multiline_newline_test.dart.

This bug is spec-wise related to dartbug.com/14073

@kasperl

@johnniwinther johnniwinther added the area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). label Jul 22, 2015
@lrhn
Copy link
Member

lrhn commented Aug 18, 2015

This hit another test (lib/convert/line_splitter_test.dart) which used multi-line strings as test data, and which failed with Windows line endings.

@johnniwinther
Copy link
Member Author

Issue #23020 also relates to this.

@munificent
Copy link
Member

Marking this as a duplicate of #23562, which is older.

@munificent munificent added the closed-duplicate Closed in favor of an existing report label Dec 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

4 participants