A negative result was wrongly returned as a positive value.
Since positive values are preferred, the implementation now adds the modulus
enough times to make the result positive.
Change-Id: I87a2ceb359345846740a749ab6b46b1d45e7ba21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103664
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit a9ad427 introduced a bug that assumed the cookie value was at least
one character, but the cookie value can also be empty.
RFC 6265 5.2 does not specify any special behavior for double quotes and as
such they should be considered part of the value. This change stops
stripping those double quotes and instead preserves them.
The io/http_cookie_test test was skipped because it was considered flaky.
This change dusts it off and tests the new behavior.
This change adds the exact offsets and source to the FormatExceptions to
help the caller understand why a malformed cookie was rejected.
Fixes https://github.com/dart-lang/sdk/issues/33327
Fixes https://github.com/dart-lang/sdk/issues/35804
Change-Id: I3479ba48be5763c485bd3ca5b5d2d86d283df971
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/91221
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: William Hesse <whesse@google.com>
As mentioned in #28303 Dart needs the innerText getter/setter.
This seems like all thats needed.
Closes#35471https://github.com/dart-lang/sdk/pull/35471
GitOrigin-RevId: 95f45dd8ba1d0ce58acbeb99242c45b56c586f85
Change-Id: I3514e02915b4c388d6fe2462976e0a88a6081493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100822
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
This change clarifies that dart:io's RawSocket is not an operating system
raw socket, which can be used to access the raw network protocol layer, but
is instead an API for accessing the transport protocol layer.
Closes https://github.com/dart-lang/sdk/issues/36792.
Change-Id: Id7a413184cb878e179778e4b5535abdc5527b270
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100844
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.
This adds support for the following features:
* Interpreting patterns as Unicode patterns instead of
BMP patterns
* the dotAll flag (`/s`) for changing the behavior
of '.' to also match line terminators
* Escapes for character classes described by Unicode
property groups (e.g., \p{Greek} to match all Greek
characters, or \P{Greek} for all non-Greek characters).
The following TC39 proposals describe some of the added features:
* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes
These additional changes are included:
* Extends named capture group names to include the full
range of identifier characters supported by ECMAScript,
not just ASCII.
* Changing the RegExp interface to return RegExpMatch
objects, not Match objects, so that downcasting is
not necessary to use named capture groups from Dart
**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.
Change-Id: Ie62e6082a0e2fedc1680ef2576ce0c6db80fc19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100641
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
This reverts commit 5ebb640a67.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> [vm] Finish adding support for ECMAScript 2018 features.
>
> This work pulls in v8 support for these features with
> appropriate changes for Dart and closes
> https://github.com/dart-lang/sdk/issues/34935.
>
> This adds support for the following features:
>
> * Interpreting patterns as Unicode patterns instead of
> BMP patterns
> * the dotAll flag (`/s`) for changing the behavior
> of '.' to also match line terminators
> * Escapes for character classes described by Unicode
> property groups (e.g., \p{Greek} to match all Greek
> characters, or \P{Greek} for all non-Greek characters).
>
> The following TC39 proposals describe some of the added features:
>
> * https://github.com/tc39/proposal-regexp-dotall-flag
> * https://github.com/tc39/proposal-regexp-unicode-property-escapes
>
> These additional changes are included:
>
> * Extends named capture group names to include the full
> range of identifier characters supported by ECMAScript,
> not just ASCII.
> * Changing the RegExp interface to return RegExpMatch
> objects, not Match objects, so that downcasting is
> not necessary to use named capture groups from Dart
>
> **Note**: The changes to the RegExp interface are a
> breaking change for implementers of the RegExp interface.
> Current users of the RegExp interface (i.e., code using Dart
> RegExp objects) will not be affected.
>
> Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
> Commit-Queue: Stevie Strickland <sstrickl@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=lrn@google.com,kustermann@google.com,jmesserly@google.com,johnniwinther@google.com,sstrickl@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I1eda0fee4fd9e94df095944049833a67b07277e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100560
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.
This adds support for the following features:
* Interpreting patterns as Unicode patterns instead of
BMP patterns
* the dotAll flag (`/s`) for changing the behavior
of '.' to also match line terminators
* Escapes for character classes described by Unicode
property groups (e.g., \p{Greek} to match all Greek
characters, or \P{Greek} for all non-Greek characters).
The following TC39 proposals describe some of the added features:
* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes
These additional changes are included:
* Extends named capture group names to include the full
range of identifier characters supported by ECMAScript,
not just ASCII.
* Changing the RegExp interface to return RegExpMatch
objects, not Match objects, so that downcasting is
not necessary to use named capture groups from Dart
**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.
Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
We do not expect any client uses of the precompiled SDK in this module format. The only know use
case builds the SDK manually first.
Add simple tests that files can be compiled with `--modules legacy` option.
Issue: #35988
Change-Id: Ie2c4244e5876bb04f968b0198f5763ff3d29c01c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99921
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Fixes https://github.com/dart-lang/sdk/issues/34147.
The Dart language specification says we should ensure booleans are
non-null in the following (non-exhaustive) situations:
* (ternary) conditional expressions - this includes the `!` operator
since `!x` is equivalent to `x ? false : true`
* arguments to logical boolean expressions (`||` and `&&`), modulo
short-circuiting
* `if` conditions
* `for` loop conditions
* `while` conditions
* `do`/`while` conditions
With control-flow-collections enabled, this CL will also cover
conditions in `if` elements and `for` elements. Tests for these already
exist in
language_2/control_flow_collections/{if,for}_null_condition_test.dart.
Change-Id: I2ce9a30adeb16a0a68411f358f69aeca08656dab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98780
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Previously, a valid web socket connection would use the following URI:
`ws://127.0.0.1/ws`
Now, by default, the VM service requires a connection to be made with a
URI similar to the following:
`ws://127.0.0.1:8181/Ug_U0QVsqFs=/ws`
where `Ug_U0QVsqFs` is an authentication code generated and shared by the
service.
This behavior can be disabled with the `--disable-service-auth-codes`
flag.
Change-Id: I288aac58e3ba9d35dca8071f3f7e7a073896c271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98433
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
(And do the same for `base64Encode` and `base64Decode`.)
Motivated by <https://stackoverflow.com/questions/54859595/>.
Change-Id: I776cb26b7588b3b8a18a2185460477df3a16598b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94986
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: James Lin <jamesdlin@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This is needed to prevent frontend from attempting to evaluate this constant during compile time.
Change-Id: If6c72f1ab6b3d7e3ea753703e79b388c39fbeca9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98698
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Adds:
- dart2aot, a script similar to dart2js which compiles my.dart to my.dart.aot.
- dartaotruntime, a minimal Dart runtime that only runs AOT blobs.
- some extra tooling like gen_kernel and gen_snapshot used by the above.
- build rules for all of the above, including adding it to the full SDK builds.
Bug:https://github.com/dart-lang/sdk/issues/27596
Change-Id: Ic35f832b2b86be959212b8d21cfc5a082da5ced4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97627
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
- Typed array elements are never null, but type inference sometimes
thinks they are.
- Annotated isNan and isFinite as pure.
Change-Id: I5fffd237374444db27665009cf550b26563bcf55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98046
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
dartfmt -w --fix-optional-new --fix-optional-const --fix-named-default-separator --fix-function-typedefs .
Change-Id: I9b1d6b8a604384afed0ece35a9a7f849edba46df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97563
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Change-Id: Ie97da6a9347b6c3a96ae5854c8b7d6ba1be0dba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97354
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Change-Id: I1ffb3c418479903d982f17753e74d264b9341361
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97447
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Change-Id: I261d6c414014e7682a9ef5555e7194d287aa2ecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97324
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
See https://github.com/tc39/proposal-regexp-named-groups
for a high-level description of the feature and examples. This is one of the
features requested in https://github.com/dart-lang/sdk/issues/34935.
This is a partial implementation because while there is a way to retrieve
groups via Dart by name, it requires casting the returned Match to the
new RegExpMatch interface to avoid changing the RegExp interface.
Changing the RegExp interface will happen in a future update, since there
are other planned changes to the RegExp interface coming soon and that way
we only change it once. See https://github.com/dart-lang/sdk/issues/36171
for more details on the planned changes.
Also, since only BMP regular expressions are supported, not full
Unicode ones (i.e., those with the /u flag in ECMAscript), \k<NAME>
will only be parsed as a named back reference if there are named
captures in the string. Otherwise, the \k will be parsed as the identity
escape for backwards compatibility. The new tests illustrate this
difference.
Change-Id: Ieeb0374813db78924c9aa8ac3e652dfb6d4a5934
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95461
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
These new exceptions have no legacy values.
DataCloneError - The object can not be cloned.
EncodingError - The encoding or decoding operation failed.
NotReadableError - The input/output read operation failed
UnknownError - The operation failed for an unknown transient reason (e.g. out of memory).
ConstraintError - A mutation operation in a transaction failed because a constraint was not satisfied.
DataError - Provided data is inadequate.
TransactionInactiveError - A request was placed against a transaction which is currently not active, or which is finished.
ReadOnlyError - The mutating operation was attempted in a "readonly" transaction.
VersionError An attempt was made to open a database using a lower version than the existing version.
OperationError - The operation failed for an operation-specific reason.
NotAllowedError - The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
R=vsm@google.com
Change-Id: I1245bc788fd287d566f42184ebe914165afa95ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97163
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
The lazy static initializer returns null after throwing on the first use.
Change-Id: I44fbb6f8af263dc5c813ed5dff2291fb27e48b4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96984
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Rather than creating the abiversions directory during gclient update,
check in an (almost) empty directory. This fixes the flutter build.
Bug: https://github.com/dart-lang/sdk/issues/36047
Change-Id: Ied74210bfc1c8fda998f58f754eac3949ebe0718
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96846
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
Change-Id: Ia643bb49fe22150f794a187a71c19ad4c61b5694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96663
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
- Setting the `disableBreakpoints` parameter to true will result in any
breakpoints hit during execution resulting from an evaluate or invoke
call to be ignored.
- Default behavior is the same (break on breakpoints).
- Updated Observatory eval box to disable breakpoints.
- Added tests
Change-Id: Ibf40f8a8de018718435118e13cc2e969f8ed7944
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95320
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
@ForceInline is still used by dart:html, will be removed in a later CL.
Change-Id: I480325fe91cc6baefb17ead49f839442e023d441
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95160
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
The size of the result digit array was not computed correctly.
When 64-bit intrinsics are used, one extra digit pair must be allocated.
Change-Id: Id3ca3a16ef24b598e44bf25221d400b9be71248a
Reviewed-on: https://dart-review.googlesource.com/c/94683
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
With a nanosecond tick counter, the elapsedMicroseconds getter
could overflow if a stopwatch runs for only ~2.5 hours.
Change-Id: I10cb54bba928713a3127a6bfbd19346b01d775b0
Reviewed-on: https://dart-review.googlesource.com/c/94381
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>