Skip to content

Dart semantics depends on newline encoding #23888

Closed
@johnniwinther

Description

@johnniwinther

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

Metadata

Metadata

Assignees

Labels

area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).closed-duplicateClosed in favor of an existing report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions