Commit graph

513 commits

Author SHA1 Message Date
Stephen Adams e769817cdc [tests] Split corelib{,_2}/list_concurrent_modify_test
Splitting out a failing test to increase coverage of other tests.

It is not clear that `a.addAll(a)` should throw if `a` is empty.
`a` is not modified by the action.

dart2js/DDC do not detect this case and I'm reluctant to add a check
for the case where `a` is in fact not modified.

The VM test is very specific to an identical argument and cannot
detect the case for `a = Mylist([])`.

Another option to this proposal is to simply delete the `[]` case.

In general, I'd like to move more ConcurrentModificationError tests
into assert statements.

Change-Id: I1f9559bdb43ea1bae0575413748c9d9d0de58b99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170023
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-11-05 19:46:35 +00:00
Alexander Markov e9aa232066 Remove remaining tests for bytecode mode
Change-Id: I9690bd8a9bdcf16963424c64c1b80628e50fa28a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166922
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-09 22:30:19 +00:00
Riley Porter febb1929cd [ddc] Copy JS 2-digit year handling from dart2js.
Fixes https://github.com/dart-lang/sdk/issues/42894

Change-Id: I68a8782d123c299ec34bfd0a31b3108138dac117
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164681
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2020-09-26 01:11:54 +00:00
Nate Bosch 735bcbe10d Allow reading null current with unsound null safety
Fixes #42950

It was previously allowed, though non-sensible, to read `.current`
before advancing the iterator for a `RegExp.allMatches` iterable and get
`null`. Using `as` allows backward compatibility in unsound null safety
mode, while `!` is breaking since it introduces a null check in either
mode.

The new behavior is also the behavior of the migrated code for DDC since
https://dart-review.googlesource.com/c/sdk/+/151121

Change-Id: I9f3654298a3d480ec2f297a40a4145ff6ca9f011
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157880
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2020-09-18 17:43:57 +00:00
Tess Strickland bb24f76c72 [vm] Reland "Remove non-covariant checks from closure bodies (part 1)"
Also relands the followup CLs:
"Perform non-covariant checks when dynamically invoking callables."
"Use AreValidArguments so that names are checked as well."

Original description of first CL:

This change only affects compilation when running in non-precompiled
mode with --no-lazy-dispatchers enabled.

Instead of always compiling in non-covariant checks, even for closures
not called dynamically, remove the non-covariant checks from the closure
and instead do the non-covariant checks for dynamic calls during the
NoSuchMethodForCallStub fallback by calling
Function::DoArgumentTypesMatch.

Adds two overloads for Function::DoArgumentTypesMatch, one which takes a
function type argument vector and one which takes neither an
instantiator type argument vector or a function type argument vector.
For the versions that are not explicitly passed a type argument vector,
an appropriate one is constructed using the arguments. If there is not
enough information in the arguments, then we fall back to assuming the
empty type argument vector for the instantiator case and instantiating
to bounds in the function type argument case.

Fixes Function::DoArgumentTypesMatch to handle generic functions and to
check arguments appropriately according to the active null safety mode.
For generic functions, the provided or resulting function type vector
has non-covariant checks performed against the type parameter bounds.

This change uncovered one test that was incorrectly passing in strong
mode, see https://github.com/dart-lang/sdk/issues/42688 for details.

Original description of second CL:

The VM only does this when the callable function does not expect dynamic
invocations. Otherwise, performing the checks would be redundant, as the
function body already contains the appropriate non-covariant checks.

Third CL had no additional description.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-try,vm-kernel-reload-linux-release-x64-try, vm-kernel-reload-rollback-linux-debug-x64-try
Bug: https://github.com/dart-lang/sdk/issues/40813
Change-Id: I1a3e9c1865103a8d716e1cad814267caffaaadf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154688
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-07-21 10:00:41 +00:00
Alexander Aprelev d6eb87bbcc Revert "[vm] Remove non-covariant checks from closure bodies (part 1)" as it broke language_2/vm/no_such_args_error_message_vm_test.
This reverts commit 556f0fb5c8 and fixes merge conflict.

Revert "[vm] Perform non-covariant checks when dynamically invoking callables." as a collateral.

This reverts commit 7a6287bb92.

Revert "[vm] Use AreValidArguments so that names are checked as well." as a collateral

This reverts commit 90c683018f.

Change-Id: Iee2c5e91c39d19dca7a1e640c103443c95e6c4f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154705
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-07-16 23:25:54 +00:00
Tess Strickland 556f0fb5c8 [vm] Remove non-covariant checks from closure bodies (part 1)
This change only affects compilation when running in non-precompiled
mode with --no-lazy-dispatchers enabled.

Instead of always compiling in non-covariant checks, even for closures
not called dynamically, remove the non-covariant checks from the closure
and instead do the non-covariant checks for dynamic calls during the
NoSuchMethodForCallStub fallback by calling
Function::DoArgumentTypesMatch.

Adds two overloads for Function::DoArgumentTypesMatch, one which takes a
function type argument vector and one which takes neither an
instantiator type argument vector or a function type argument vector.
For the versions that are not explicitly passed a type argument vector,
an appropriate one is constructed using the arguments. If there is not
enough information in the arguments, then we fall back to assuming the
empty type argument vector for the instantiator case and instantiating
to bounds in the function type argument case.

Fixes Function::DoArgumentTypesMatch to handle generic functions and to
check arguments appropriately according to the active null safety mode.
For generic functions, the provided or resulting function type vector
has non-covariant checks performed against the type parameter bounds.

This change uncovered one test that was incorrectly passing in strong
mode, see https://github.com/dart-lang/sdk/issues/42688 for details.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-dartkb-linux-release-x64-try
Change-Id: I5030a46b356778448b51a243f16406eacf1c04bf
Bug: https://github.com/dart-lang/sdk/issues/40813
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153202
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-07-16 14:54:04 +00:00
David Morgan 1d3fbbed7c Revert "Fix duration.toString() to conform the description"
This reverts commit 038e981f89.

Reason for revert: Breaks some tests; visible changes to some web UIs.

Original change's description:
> Fix duration.toString() to conform the description
> 
> Duration.toString() should return in a format of "HH:MM:SS.mmmmmm".
> But when `hours` is less than 10, toString() doesn't have the leading
> zero, which is "H:MM:SS.mmmmmm".
> 
> The corresponding co19 issue: https://github.com/dart-lang/co19/issues/733
> 
> Bug: https://github.com/dart-lang/sdk/issues/41737
> Change-Id: I2264171b2b37e89056695f7f821125a5f78d87fb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151163
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=lrn@google.com,zichangguo@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I4d7ef5de9807e8e2b2a77c2171d1693b7527f671
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151848
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-06-22 10:29:15 +00:00
Zichang Guo 038e981f89 Fix duration.toString() to conform the description
Duration.toString() should return in a format of "HH:MM:SS.mmmmmm".
But when `hours` is less than 10, toString() doesn't have the leading
zero, which is "H:MM:SS.mmmmmm".

The corresponding co19 issue: https://github.com/dart-lang/co19/issues/733

Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I2264171b2b37e89056695f7f821125a5f78d87fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151163
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-06-19 22:52:30 +00:00
William Hesse d3959945f7 Skip unicode surrogate test on android
This test crashes the android test runner, and should be fixed
when issue https://github.com/dart-lang/sdk/issues/42094 is rolled
to the checked-in SDK.

BUG=https://github.com/dart-lang/sdk/issues/42094

Change-Id: I91e5ea5358b08d3776ae485b90aff7cd01d02322
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149580
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-30 23:29:02 +00:00
James Lin 10e8d5d1a6 Try to clarify the RangeError.range message
The old RangeError.range message was confusing:

  RangeError (index): Invalid value: Not in range 0..2, inclusive: 9

The comma makes the message hard to parse.  I've seen a number of
people misinterpret "inclusive" as describing the invalid value (9)
instead of acting as a modifier on the range.

https://github.com/dart-lang/sdk/issues/29586 has a lot of
bikeshedding about this, but in the interest of mitigating confusion
sooner, I propose changing it to:

  RangeError (index): Invalid value: Not in inclusive range 0..2: 9

I'm intentionally trying to improve the message with minimal
disruption to the structure of the error message.  Although I'd much
prefer that "Invalid value" and the actual value be adjacent instead
of being interrupted by the explanation, such restructuring is rather
non-trivial.  RangeError allows the "Invalid value" message to be
customized, and rearranging terms could produce even worse
constructions.

I also considered:

  RangeError (index): Invalid value: Not in range [0, 2]: 9

And while I like that that is brief and clear, I chose not to use it
for people who are unfamiliar with interval notation and who might
mistake it as a Dart List.

Bug: https://github.com/dart-lang/sdk/issues/29586
Change-Id: I0f23b195437e4053ae5f76b5d303123979a8c9fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146024
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-27 14:59:39 +00:00
Stephen Adams 1924d64351 [corelib] Fix for BigInt.toDouble() crash
Bug: 41819
Change-Id: Ied24b42728e1da0d713fe971386d4ef6a023333e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147349
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-09 00:22:16 +00:00
Konstantin Shcheglov 20917915bb Update corelib/list_test for default exception type change.
R=brianwilkerson@google.com

Change-Id: I2bb89d5c422872ba5008c6375b8f27b02b9a95c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146683
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-05-05 22:25:27 +00:00
Riley Porter 654b725ee4 [tests] Fix cast_test and migrate to nnbd.
Also splits up cast_test to test collections separately and
updates corelib_2 version with the same changes, including
fixes in relevant pending CL:
https://dart-review.googlesource.com/c/sdk/+/126320

Fixes #39517

Bug: http://dartbug.com/39517
Change-Id: I8df1fde1d48ed23561ce9d0d8b87d7fc2ba52eb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144469
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-04-30 02:33:53 +00:00
Riley Porter b9d35ded2e [tests] Clean up List constructor usage and unused multi-test
Split out int64 lines of multi-test for
corelib/iterable_return_type_test and added status to skip the
int64 test on the web compilers.

Change-Id: I1e56299973956932c5b16b1ceeeb2b8f00457bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141802
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2020-04-01 00:03:46 +00:00
Erik Ernst 7afb23a7d9 Added new tests.
One test verifies that the default values of fromEnvironment
constructors are the values false/0/''.

The other new test verifies that it is allowed to invoke an expression
whose static type is a proper subtype of a function type (X extends F,
where F is a function type), cf.
https://github.com/dart-lang/language/issues/896.

Change-Id: I4ee32df7c5950be07b800027f000a486bf3af61c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141249
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-03-27 19:02:52 +00:00
Erik Ernst e3af7e724f Update usage of int/String fromEnvironment
Breaking change 40678 requires the constructors int.fromEnvironment and
String.fromEnvironment to get new default values for the named
parameter `defaultValue`. This CL changes usages of these constructors
such that they do not depend on the default value, such that it
becomes a non-breaking change for code in the SDK repo to perform the
change in sdk and in sdk_nnbd.

Change-Id: I82af0e1f92d6cd3618b65c0c50d754ae8c39eb0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140284
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-03-24 11:19:14 +00:00
Lasse R.H. Nielsen 8ab3dcf709 Make ArgumentError.check* functions return the valid argument.
This makes these checks useful in situations where you don't want to spend
an extra statement, like `=>` bodies or initializer lists (including
forwarding generative constructors).

Change-Id: Ia55b8741a7c75af631db48ac70e64597d8f96c73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135649
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-03-23 18:00:09 +00:00
Riley Porter 924d759f7a Convert from _JsonMap to Map<String, Object> in corelib/map_entry_test
The json.decode function returns a _JsonMap, which is a Map<String, dynamic>
and could include nulls. Without converting to a Map<String, Object>,
the migrated map_entry_test for the nnbd sdk causes a runtime error.

Change-Id: I8b66e693a5f91c1e14f7a89d887ac4c4549442a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139753
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2020-03-20 17:58:22 +00:00
Erik Ernst 568255dbec Change tests to expect new behavior of fromEnvironment
Constructors int.fromEnvironment and String.fromEnvironment will now
yield 0 or '' rather than null in the case where the requested
environment declaration does not exist, so various expectations needed
to be updated accordingly.

Change-Id: Ie6f3b9ee18a970e50520ac84c2741b4875ada3c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139804
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-03-17 13:43:17 +00:00
Lasse R.H. Nielsen 468f9eb2f9 Backport changes to RuneIterator to non-NNBD SDK.
Change-Id: I02087a794cd731348f00e34eee8b154f80fe4c9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135316
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-03-12 16:47:46 +00:00
Leaf Petersen 5e9be81d5e Make all CastErrors be TypeErrors.
This makes CastError implement TypeError, and changes all test
expectations to look for TypeError.  A followup CL will deprecate
CastError.

Bug: https://github.com/dart-lang/language/issues/787
Bug: https://github.com/dart-lang/sdk/issues/34097
Change-Id: I7102c6260901317572d2df08c4be9c4c48197688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138670
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-03-11 23:31:06 +00:00
Lasse Reichstein Holst Nielsen 9e10ef4458 Fix null-read in RegExpMatch.groupNames.
Fixes VM, DDC and Dart2js.

BUG= http://dartbug.com/39406

Change-Id: If181eaf50905c571614b656a232564e394e1b35d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136635
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-03-11 14:21:39 +00:00
Vijay Menon 729ee5f725 [nnbd] skip runes tests that are no longer valid
Bug: https://github.com/dart-lang/sdk/issues/40674
Change-Id: Ie67ab796140e93667750055cc2623543cdafa702
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138000
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-03-03 16:16:21 +00:00
Régis Crelier 432fa1b4e8 [VM/nnbd] Implement pre-nnbd language changes (see lang/#807).
Normalize FutureOr<T> and Never? after instantiation.
Use mutual subtyping of bounds in generic function type parameters instead of structural equality.

Change-Id: I78b836d8bd2f091bd56e5a0f9c2089a411fa6f6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135787
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2020-02-26 21:32:51 +00:00
Mayank Patke ed441e48d0 Update all Slow tests to be Slow, Pass.
Change-Id: I610b272355b045eab80cf941210774fb12d775eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134103
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-01 00:17:42 +00:00
Robert Nystrom fd501c74a5 Track files that do not need to be migrated in the NNBD progress script.
Change-Id: I77014aad502ae6e44a9d0c20c288efb822bd1068
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128984
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-12-20 21:25:35 +00:00
Robert Nystrom b998b10f3e Migrate remaining corelib_2/ tests to NNBD.
Change-Id: I3a31632ce28fb87a410b759d092c7ebc9393574d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128306
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-12-17 23:06:24 +00:00
Simon Lightfoot 867a6e0e52 [dart:core] Update DartTime.parse to support arbitrary precision fractional seconds.
Update DartTime.parse to support arbitrary precision fractional seconds. So it now conforms to ISO8901 and RFC3339 standards.

Closes #24205

Closes #39350
https://github.com/dart-lang/sdk/pull/39350

GitOrigin-RevId: 66f15b6e646a65b7955c7b617647b8edfd680481
Change-Id: Ife2211e6cce5922b59cdde0d30ed3ef887cffcf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124903
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2019-11-20 18:16:19 +00:00
Samir Jindel c885bdde1d [vm] DBC is obsolete. Remove dead code.
Change-Id: Ica33af158cca53c8e951e4b2582de83660e8a60d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121851
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-27 18:18:29 +00:00
Martin Kustermann e82fedc345 [vm] Remove deprecated (and untested) ARMv5 support from the VM
Since we have no CQ/CI test coverage of ARMv5 and none of our customers
uses it, a breaking change request was made (see issue further down).

The breaking change has been approved and a corresponding email has been
sent out:

https://groups.google.com/a/dartlang.org/forum/?nomobile=true#!topic/announce/vRQja7di3FQ

This CL removes any armv5 related code from our codebase.

Closes https://github.com/dart-lang/sdk/issues/36666

Change-Id: I9abf32f1980ca19a9cf882b43c9966b2127f89e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-23 14:44:33 +00:00
Karl Klose 16bb96aa25 [infra] Remove non-essential test expectations with comments from general status files
Change-Id: I8aa918b4065eaa9ae8e4501c6a77328659784f9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114848
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-10-01 06:18:59 +00:00
Ryan Macnak 8a5e2a688b [vm, compiler] Consistently produce OutOfMemoryErrors for large variable-length object allocations.
Bug: https://github.com/dart-lang/sdk/issues/38575
Change-Id: I3f93488511519ac1dca04f91465efad3d2a0c66d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118886
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-09-30 20:19:03 +00:00
Aske Simon Christensen 7799f424f4 [CFE] Encapsulate int operations in separate classes for VM and JS
This refactoring achieves the following:

- Collect the integer operation semantics into one place instead of
having it sprinkled all over the constant evaluator with many
"if (targetingJavaScript)" tests.

- Avoid emitting the internal JavaScriptIntConstant node, which is
serialized as normal DoubleConstant nodes, thus achieving parity
between direct consumers and consumers seeing output that has been
serialized.

- Implement the JavaScript semantics for unsigned right shift.

- Fix truncating divide with a result outside int64 range incorrectly
clamping the result for JS targets.

- Fix positive hex constants >= 2^63 through int.fromEnvironment
producing negative values in dart2js.

- Clarify in Kernel documentation how numeric constants are represented
on VM vs JS targets.

Change-Id: If30bb2c2c77c54eff120b611b059c2ec726c99a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116525
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-16 13:10:59 +00:00
Mayank Patke 81c9fb8e63 Fix corelib_2/nsm_invocation_generic_test.
Change-Id: I0906988498ad6a8d9acabc103d759bed9c01ee83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116891
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-09-12 18:17:46 +00:00
Mayank Patke a689f8df06 corelib_2/unsigned_shift_test fixes
Just doing some test cleanup on massively failing tests. This test still won't pass until we support `>>>` but we can fix some of the issues.

Change-Id: I1a111455c969f21644ab2713f81f4ee00e7383f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115881
Auto-Submit: Mayank Patke <fishythefish@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-09-06 19:49:57 +00:00
Robert Nystrom 89ad636b58 Remove the old "preview Dart 2" flags from the test runner.
Dart 2 shipped a year ago, so we're pretty well past a "preview". :)

Change-Id: I6c5d21ae4181e4228cc1fc49b6344cdb8fc43794
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115544
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-09-05 16:59:43 +00:00
Karl Klose 095d1c2835 [infra] Clean up general status files
Change-Id: I421fca89e748474a585f052532b86ef3ddbed4ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113681
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-08-21 09:18:34 +00:00
Stephen Adams f77093145a [corelib] Test for overflow in int.modPow()
Bug: 37469
Change-Id: If7a6cc1063ddfdab1c5a0261a7b0c5d168c081b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109316
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-17 13:49:05 +00:00
Alexander Markov 96906936b4 [vm/bytecode] Fix writing and reading of nested function types in bytecode
Fixes https://github.com/dart-lang/sdk/issues/37486

Change-Id: Id6b10288cf9afeddb8a9972eb1dd455184b15789
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108740
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-07-12 00:15:32 +00:00
Stephen Adams 2c26ece3cf [gardening] Fix non-web-integer in corelib_2/num_parse_test
Change-Id: Ie89d5065cc6a3c3a05f8bf52c57b8f082a830b2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108760
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-11 17:53:53 +00:00
Lasse Reichstein Holst Nielsen 84c7929c1f Small fixes.
Fix typo in test, add @Since markers to new constructors.

Change-Id: I31abbf41049a3d5820d82165ab16ce8357c79132
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108722
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-07-11 10:39:03 +00:00
Lasse R.H. Nielsen ac41a20081 Update language_2/nested_generic_closure_test.dart.
No longer depends on the unspecified `Type.toString`.

Bug: http://dartbug.com/37452
Change-Id: Ie7eeeecdc8970831082e763edc46f195a8bfc7e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108275
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2019-07-10 09:46:41 +00:00
Stephen Adams 803658a6d8 [corelib_2] fix bigint_from_test for web platforms
Change-Id: Ib97814ba6b30822296c24026ddcd09f119508ed7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108422
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-09 18:25:52 +00:00
Stephen Adams 8673b5e491 Avoid non-web-integer literals in corelib_2/num_sign_test
Change-Id: I756ef8129b0e1c7024833fb98ed96eea987dbb59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108280
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-05 19:43:47 +00:00
Stephen Adams f0da490328 Avoid non-web integer literal in corelib_2/growable_list_test
dart2js will now fail with an unchecked ConcurrentModificationError.

Change-Id: I54ddc4198538f4b9276ef0f4692fd74590a38135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108240
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-07-05 15:52:47 +00:00
Stephen Adams 7b13c45bcc Fix negation precedence and non-web-integers in corelib_2/int_xxx_tests
Change-Id: Ia464ac9c33e19483559abc600e8933aad0499fb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108163
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-05 14:23:56 +00:00
Stephen Adams f41d6de111 [corelib_2] Split date_time_test to increase coverage
After moving ~175 lines to other files, the remaining ~1200 lines of
tests in date_time_test.dart passes on dart2js.


Change-Id: Id8366b90083c22f71e5ff2e3f36ac1f0358ec8e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108220
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-04 15:16:55 +00:00
Stephen Adams 4babccd988 Fix non-web integer literals in corelib_2/bigint_test
Change-Id: I9cb66de2db293a033073ced7e6b9e3d19a1f3fb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108204
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-07-04 02:49:29 +00:00
Stephen Adams 052874e93e Avoid non-web integer literal in corelib_2/int_round_test
Also fix precedence bug.

Change-Id: I4b4746e0adfd0ff354d85519665ae23742f8703a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107838
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-03 16:20:07 +00:00