Commit graph

2142 commits

Author SHA1 Message Date
Daco Harkes 21af69a7a5 Revert "[vm] Don't block OOB messages during field initialization; make interrupts lock-free."
This reverts commit 4d789f60d1.

Reason for revert: TSAN races
https://github.com/dart-lang/sdk/issues/46596

Original change's description:
> [vm] Don't block OOB messages during field initialization; make interrupts lock-free.
>
> TEST=ci
> Change-Id: I51d0f51995e197ab71c059f17d22259eea19c286
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206566
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I777f5a0bbeb3cd60e03aff46183b19ab4e286664
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206545
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-07-13 11:30:08 +00:00
Srujan Gaddam 8f11985c47 [pkg:js] Test runtime is checks
The is checks in is_check_and_as_cast_test.dart are currently optimized
by dart2js at compile time. In order to test them at runtime, is checks
are added after confusing the instance.

Also adds this test file to lib_2.

Change-Id: I3a77c779799f77342297508b89367ab8b64c3241
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205600
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-07-13 01:28:55 +00:00
Ryan Macnak 4d789f60d1 [vm] Don't block OOB messages during field initialization; make interrupts lock-free.
TEST=ci
Change-Id: I51d0f51995e197ab71c059f17d22259eea19c286
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206566
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-07-13 00:43:05 +00:00
Erik Ernst 47502de6b0 Remove two tests using a deferred type
This is a compile-time error today, and that is tested already
elsewhere, so the test serves no purpose.

Bug: #46526
Change-Id: If098f8dc308ae4532b22f786f14a1986e2899251
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205720
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-07-01 20:53:05 +00:00
Riley Porter eaafc3deb0 Skip tests using eval to inject JavaScript on CSP build
Change-Id: I3084fa1056550e78ad09009c5c507dfa03bae78d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205631
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-06-30 23:29:17 +00:00
Riley Porter 63ac437e99 Optimize js_util callMethod calls for 0-4 arguments.
Change completes initial set of js_util optimizations. Some usages
of `getProperty`, `setProperty`, and `callMethod` with <= 4
arguments will have unnecessary checks removed by the compilers.

Change-Id: I94d5402ca9a64ad2818fd6d6a5f7f114f87348c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204562
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-06-30 20:11:44 +00:00
Lasse R.H. Nielsen 83376bf1ee Add Object.hash and Object.hashAll static helper methods.
Fixes #11617.

Bug: http://dartbug.com/11617
Change-Id: Id06fb5b3914bee24713427edbd3b9b7e86f86449
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/73360
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-06-25 11:40:35 +00:00
Nate Bosch 1948bd6109 Add fixes for HttpStatus constants
Add rename migrations for all the screaming snake case constants that
were renamed to lower camel case during the Dart 2 migraiton.

Rename the test from `file.dart` to `io.dart` so that we can test all
deprecations for the same import together. Add a test for the same
deprecations when imported through `dart:html`.

Change-Id: Iee91d88b1b11648e8c65cfcc8d2fcfabac3954ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203820
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2021-06-22 23:39:57 +00:00
Lasse R.H. Nielsen 902f149e2c Add unawaited function and ignore extensions member.
The `unawaited` function in `dart:async` is intended for use with the `unawaited_futures` lint which is hopefully going to be part of the Dart recommended set of lints.

The `ignore` extension method is there to provide an alternative if you even want to ignore errors from a future. By having both, it makes the distinction clearer and makes it easier to not think one can be used for everything.

Change-Id: Ib96ed5ff64ead4b228721e5210efa82f76119c9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200428
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-06-22 20:03:13 +00:00
Lasse R.H. Nielsen 19252d5786 Fix behavior for -infinity width/height of rectangles.
Fixes #30186
BUG= dartbug.com/30186

Change-Id: I2994d180a4dc4d4e4bba7edec67bc2bcc2e8fc0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201568
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-06-21 13:29:39 +00:00
Gabriel Castro 820ba59dda [html] Fix nested JS Map to Dart assignment
Added check to convertNativeToDart_Dictionary to recursively convert native objects within a map to their Dart equivalent.

Fixes: https://github.com/dart-lang/sdk/issues/44319
Change-Id: I80a2bc0541454900b1c7d9635debaf72d7c120f2
Bug: 44319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201200
Commit-Queue: Gabriel Castro <gabrielmcastro@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-06-14 21:18:08 +00:00
Nicholas Shahan 0733c1f6b1 [ddc] Add unspecified nullability regression test
Change-Id: If82ef47aac1d67c5f6db636522ed0ef7de180f8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203121
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-06-10 20:18:53 +00:00
Riley Porter 30b3552ee3 Use static DartType for js_util optimizations.
Change-Id: I294af3925f15a438f8ad76b538de4ca3a227749e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202440
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-06-07 17:27:42 +00:00
Lasse Reichstein Holst Nielsen 1154efb073 Fix null-safety migration bug in VM version of fuse JSON-UTF-8 decoder.
A JSON value can be `null`, so the return type must be `Object?`, not `Object`.

Fixes #46205.

Bug: http://dartbug.com/462051
Change-Id: I9a5522e09765457dcf8cd2639abbe385d97a3186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202623
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-06-07 11:43:02 +00:00
Riley Porter f08edad8ce Optimize js_util setProperty calls for non-function values to
_setPropertyUnchecked version that can be inlined.

No change in the generated JavaScript for dart2js.

Change-Id: Ie4a8e5a34826b6c9083d34656aaa27050635cb21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200933
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-05-25 19:28:01 +00:00
Riley Porter eb14bf2472 [ddc] Limit DDC to only skip reifying tearoffs in foreign JS when in the SDK.
Change-Id: I4a671b7064da89d7595e74b22135dc9817523622
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199540
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-05-12 20:46:51 +00:00
Regis Crelier 1f55b7ca10 Reland "[VM/runtime] Refactor the representation of type parameters in the VM."
This is a reland of 8a21ab195a

Original change's description:
> [VM/runtime] Refactor the representation of type parameters in the VM.
>
> This introduces a new VM internal class 'TypeParameters' representing the declaration of a list of type parameters, either in a class or function.
> The reference to (or use of) a type parameter is still represented by the existing 'TypeParameter' class.
>
> Fixes https://github.com/dart-lang/sdk/issues/43901
> Fixes https://github.com/dart-lang/sdk/issues/45763
>
> TEST=existing ones and a regression test
>
> Change-Id: I1fde808bf753cc1cb829f2c4383c1836651cee80
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189942
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

This fixes https://github.com/dart-lang/sdk/issues/45911

TEST=existing ones and a regression test

Change-Id: I709d38b1df3d73fe3c9796d5aca3cbbdcf77fd38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198380
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-05-05 23:43:14 +00:00
Lasse R.H. Nielsen 3e9cdc5644 Seal typed-data types.
Change-Id: Ic20b68fc258ddbf5c007f9d357366d8a41d1f1e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192186
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-05-05 18:04:05 +00:00
Michal Terepeta c6bffaf19e Revert "[VM/runtime] Refactor the representation of type parameters in the VM."
This reverts commit 8a21ab195a.

Reason for revert: Test failure: http://b/187227619

Original change's description:
> [VM/runtime] Refactor the representation of type parameters in the VM.
>
> This introduces a new VM internal class 'TypeParameters' representing the declaration of a list of type parameters, either in a class or function.
> The reference to (or use of) a type parameter is still represented by the existing 'TypeParameter' class.
>
> Fixes https://github.com/dart-lang/sdk/issues/43901
> Fixes https://github.com/dart-lang/sdk/issues/45763
>
> TEST=existing ones and a regression test
>
> Change-Id: I1fde808bf753cc1cb829f2c4383c1836651cee80
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189942
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,regis@google.com,sstrickl@google.com

Change-Id: If12caa1a84cb6d1c1b8225589f3c994d25abb120
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198282
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-05-05 10:03:57 +00:00
Regis Crelier 8a21ab195a [VM/runtime] Refactor the representation of type parameters in the VM.
This introduces a new VM internal class 'TypeParameters' representing the declaration of a list of type parameters, either in a class or function.
The reference to (or use of) a type parameter is still represented by the existing 'TypeParameter' class.

Fixes https://github.com/dart-lang/sdk/issues/43901
Fixes https://github.com/dart-lang/sdk/issues/45763

TEST=existing ones and a regression test

Change-Id: I1fde808bf753cc1cb829f2c4383c1836651cee80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189942
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-05-04 15:47:01 +00:00
Nate Bosch 71fc33e427 Enable experiment generic_metadata
Change-Id: Iff050e6a2a1c0c2b8baca211a523f9dd77cfbd4a
TEST=Existing tests for the feature.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193748
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2021-04-27 20:16:08 +00:00
Dan Field 5776d576a0 Reland "Make throwing Zone.uncaughtError handlers propagate the error to their parent zone."
This reverts commit f0a8b63402.

Reason for revert: The Flutter SDK issues have been resolved - see https://github.com/flutter/flutter/issues/80969 and https://github.com/flutter/flutter/pull/81014

Original change's description:
> Revert "Make throwing Zone.uncaughtError handlers propagate the error to their parent zone."
>
> This reverts commit 88a351f3d2.
>
> This broke the Dart SDK -> Flutter Engine roller. Flutter issue at https://github.com/flutter/flutter/issues/80969
>
> Change-Id: Idaf255a730c7b6054e6cd929b6770dbe66860151
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196561
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Zach Anderson <zra@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: Icd98c550c63160f35cc5da40af7ca6bf2cbf180e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196621
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
2021-04-23 05:24:41 +00:00
George Wright f0a8b63402 Revert "Make throwing Zone.uncaughtError handlers propagate the error to their parent zone."
This reverts commit 88a351f3d2.

This broke the Dart SDK -> Flutter Engine roller. Flutter issue at https://github.com/flutter/flutter/issues/80969

Change-Id: Idaf255a730c7b6054e6cd929b6770dbe66860151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196561
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-04-22 22:20:16 +00:00
Emmanuel Pellereau 335f55a601 Revert "Optimize js_util setProperty calls for non-function value types."
This reverts commit 853597a978.

Reason for revert: Breaks google3 (b/186088197)

Original change's description:
> Optimize js_util setProperty calls for non-function value types.
>
> No change in the generated JavaScript for dart2js base on a sample
> foo.dart file and tests/lib/js/js_util/properties_test.dart
>
> Bug: #44533
> Change-Id: Ib6866fa7fca1f13b03c75dd4f1eac904b18811e3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193838
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Riley Porter <rileyporter@google.com>

TBR=sigmund@google.com,srujzs@google.com,rileyporter@google.com

Change-Id: I3f08d29e2d6a1a7846b8d67fadc314ad947f54cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: #44533
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196484
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2021-04-22 09:27:29 +00:00
Riley Porter 853597a978 Optimize js_util setProperty calls for non-function value types.
No change in the generated JavaScript for dart2js base on a sample
foo.dart file and tests/lib/js/js_util/properties_test.dart

Bug: #44533
Change-Id: Ib6866fa7fca1f13b03c75dd4f1eac904b18811e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193838
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-04-21 19:01:11 +00:00
Lasse Reichstein Holst Nielsen 88a351f3d2 Make throwing Zone.uncaughtError handlers propagate the error to their parent zone.
Avoids infinite recursion when the uncaught error is handled by the same,
potentially still failing, uncaught error handler.

Bug: https://github.com/dart-lang/sdk/issues/45616, https://github.com/dart-lang/sdk/issues/45617
Change-Id: I60ee0f1220b7345f4a41e1f1b323b8da47ed326e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194402
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-04-21 07:52:58 +00:00
Srujan Gaddam ce5a1c2392 [dart:html] Fix sanitization for HTML templates
Bug: b/143778164

Resolves an issue where sanitization wasn't properly handled
when templates were involved.

Change-Id: Ic8f6f28036e18981eb934c2b39c2c0cd4e6f1a96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195056
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-04-13 23:29:08 +00:00
Srujan Gaddam bd58cea90b [dart:html] Fix getContext3d nullability
Closes https://github.com/dart-lang/sdk/issues/45572

getContext3d should return a nullable value since getContext can
return a nullable.

Change-Id: Iaefff781976656db3765d526ec95305f2acfeecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194503
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-04-09 19:03:43 +00:00
Srujan Gaddam 20f7013455 [pkg:js] Filter promise_reject_null_test from CSP
Test uses `eval` which is disallowed by CSP.

Change-Id: I9d1b094487226d6c7ec728d400d2c35fc6aa5c58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193063
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-03-25 22:00:19 +00:00
Srujan Gaddam 6929718456 [pkg:js] Handle null value in promise rejection
Closes https://github.com/dart-lang/sdk/issues/44602

Creates an exception to signal a `null`/`undefined` value when a
converted promise is rejected with `null`/`undefined`.

Change-Id: Ic7f14e23c6c1d51d6dbcc5831ffa8491418a4267
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192046
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-03-25 01:30:23 +00:00
Riley Porter bfaf674479 Optimize js_util getProperty calls to lowered call to native JS.
No change in the generated JavaScript for dart2js based on both a small
foo.dart sample file and tests/lib/js/js_util/properties_test.dart

All changes in generated JavaScript for DDC are smaller and clearer:
  - foo.dart: https://paste.googleplex.com/4738045023617024
  - properties_test.dart: https://paste.googleplex.com/5107699705446400

Bug: #44533
Change-Id: I670f0226fbef90d05a95c51d918831bea58d6aa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187840
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-03-06 01:16:24 +00:00
Lasse R.H. Nielsen eb6b474d7a Fix null-safety issue in VM's typed-data + operators.
Fixes #45140.

Bug: http://dartbug.com/45140
Change-Id: I95f45c64d86428ddb67d176cdd2d50cfdbadfe8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188283
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-03-01 13:56:19 +00:00
Ryan Macnak 5a385890b9 [test] Apply simarm64 status file entries to simarm64c.
Remove references to the removed simarmv6 architecture.

TEST=ci
Change-Id: I10e9fc8291c3e5b6b9a4bd71ca05de95e53f22c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187500
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-25 21:18:02 +00:00
Riley Porter b6fedb1fa9 Added skips for tests that use eval on csp configuration.
Change-Id: I4c9ed1927dfe32761245998f53eb532894087ca2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186746
Auto-Submit: Riley Porter <rileyporter@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-02-24 06:03:07 +00:00
Riley Porter 3c02a9f1b2 Refactored html/js_util_test.dart and added more js_util test coverage.
Split out async, jsify, and html tests. Also split JS$ prefix test and
skipped by design for ddc which doesn't support the prefix.

Change-Id: I85c673d791731bbae3ff4015a7e134d9180170de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185281
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-02-24 00:58:47 +00:00
Lasse R.H. Nielsen d352bc28b8 Remove (most) uses of the "non-nullable" experiment flag.
Since the flag is now enabled by default, there should be no mention of it.
There are still some uses in front_end/testcases that are not just removable
(it also uses `no-non-nullable`). There migth be more uses that are not
as easily found as grepping for `--enable-experiment

Removes two VM tests where fixing them meant they were just duplicating
the corresponding non *_2/ tests.
Fixes #44941

TEST= Large number of tests chaged.=(no-)?non-nullable`.

Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-12 17:16:54 +00:00
Srujan Gaddam bea97da4a2 [pkg:js] Language version @Native/@JS class conflict check
Bug: https://github.com/dart-lang/sdk/issues/44797

This check was previously introduced without a language version,
and therefore lead to a breaking change on SDK update. It's now
versioned for releases >= 2.13, allowing users to migrate easier.
It also adds a hint for the error, providing alternatives for
users whose code triggers this check.

Change-Id: I4f61066a917ddb18071508291cde00710802fc5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182920
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-02-05 00:23:42 +00:00
Clement Skau 2236883ff2 [SDK] Removes non-exiting tests from .status
TEST=Tested all configurations.

Change-Id: Iec00d7e6ea56221ffebcf044de22647907f598f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182500
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-02-04 06:46:13 +00:00
Riley Porter cfa35be6f0 [package:js] Added checks for external non-JS members.
Adds static errors in web backends requiring external members to be
annotated with @JS(). Members can be annotated directly, or on the
enclosing class or library.

Also removes duplicate checks in dart2js for non-native external
members that are now covered by the checks on external @JS members.

Change-Id: I2b17456f8f546f80f1ea6a817360c7f4c40f9640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-02-03 02:14:18 +00:00
pq 2ecc9b76c8 initial sdk API fix data
Some simple SDK API changes codified in fix data w/ accompanying tests.

Tests are in `tests/lib/fix_data` and run on the pkg bots.

Sample run:

https://ci.chromium.org/ui/p/dart/builders/try/pkg-linux-release-try/46526/steps?succeeded=true&debug=false
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8856735093298466576/+/steps/validate_SDK_API_data-driven_fixes/0/stdout


Change-Id: Id0959d6cde4003f114056c21b9969f2792f21a6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180940
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-02-01 18:47:59 +00:00
Lasse R.H. Nielsen bb5b0ff0ce Fix typed data views throwing.
Fixes #43204

BUG= http://dartbug.com/43204

Change-Id: I93ee6931900b79ac6755431c90d2b203ccf94ff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181401
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-29 09:24:45 +00:00
Alexander Aprelev 6b3abe0a98 [vm/concurrency] Add --experimental_enable_isolate_groups_jit flag, make --enable_isolate_groups AOT only.
Issue b/177800357.

TEST=existing test suite
Change-Id: Id6b113932ab7014b8fa6c105845c5c490b60f5e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181320
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-27 17:11:29 +00:00
Lasse R.H. Nielsen 726904ac17 Add onError extension method to Future.
Provides better typing than `catchError`.

Change-Id: If0d4487b7c3a499160fb719740a1d65c0545024d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151512
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-21 23:13:56 +00:00
Sigmund Cherem 0845ebaad8 [ddc] Do not require a @JS annotation at the library level.
Dart2js allows to declare JS-interp members, even if the enclosing library
doesn't have a JS annotation. This relaxes DDC to do the same.

Change-Id: I733d1cbb308692d89b8cd443cbde0ed30637e48e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177780
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-01-20 22:11:23 +00:00
Johnni Winther 07a6f9511d Revert "Makes _propagateToListeners not recurse unboundedly."
This reverts commit 073f792b59.

Reason for revert: Some g3 test failures, needs more investigation to figure out how to land. b/177972603

TEST=revert

Original change's description:
> Makes `_propagateToListeners` not recurse unboundedly.
>
> Change-Id: I85818282276e8a5ab4a639e98c238c2a822cab9e
> TEST=Added regression test.
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179770
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

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

Change-Id: If3b6a2ee5511a13fa2de19e70a3c52321007b1ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180142
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2021-01-20 09:27:47 +00:00
Lasse R.H. Nielsen 073f792b59 Makes _propagateToListeners not recurse unboundedly.
Change-Id: I85818282276e8a5ab4a639e98c238c2a822cab9e
TEST=Added regression test.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179770
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-19 16:47:32 +00:00
Srujan Gaddam 787ec114e1 [pkg:js] Revert revert of @Native/@JS conflicts and cache native
Bug: https://github.com/flutter/flutter/issues/73176

This reverts commit 825f56c6aa.

Both ddc and dart2js keep a set of native class names to make sure
@JS() classes don't conflict. Instead of processing native classes
for every component, this CL caches the set of native classes. This
should address the recompile time issues related to the original
revert.

Change-Id: If8028f0842440e8b9354bec9d7f72d0d42fcd8bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178926
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-01-15 01:18:02 +00:00
Danny Tuppeny c818059287 [Analyzer] Report EXTRA_POSITIONAL_ARGUMENTS and EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED against first unmatched argument
Fixes #44598.

Change-Id: I6bccf4f5448de024f27d0ed1ba51c730e22b6fe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178020
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-11 18:46:26 +00:00
Srujan Gaddam 825f56c6aa Revert "[pkg:js] Add errors for JS interop using @Native classes"
This reverts commit bc43d06479.

Reason for revert: Breakage in https://github.com/flutter/flutter/issues/73176

Original change's description:
> [pkg:js] Add errors for JS interop using @Native classes
>
> Closes https://github.com/dart-lang/sdk/issues/44211
>
> - Preprocesses and hashes Native classes defined in the sdk.
> - Adds an error if you use a JS class with the same underlying name
> as a Native class.
> - Adds tests with different namespaces to test for the error.
>
> Change-Id: I649e8b2346de8cc6d11205941a37152ce42104b9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175423
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

TBR=sigmund@google.com,srujzs@google.com,rileyporter@google.com

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

Change-Id: I4b492015468d41335fc5c9d4952560d303841695
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178260
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-01-08 18:55:02 +00:00
Regis Crelier b3bca1821c [VM/runtime] Decouple representation of function signatures from Function objects.
This fixes issue https://github.com/dart-lang/sdk/issues/43088

This CL improves on https://dart-review.googlesource.com/c/sdk/+/166920 by keeping the names of type parameters.

See go/dart-vm-signatures for motivation for this change.

TEST=existing suites

Change-Id: Ia82f1d322f72d07b2fb253cf914f9b868025c71e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176981
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-07 23:45:37 +00:00
Srujan Gaddam d683f33f5b [dart:js_util] Add checks for functions in js_util
Closes https://github.com/dart-lang/sdk/issues/44145

Introduces assertions in js_util for `setProperty`,
`callMethod`, and `callConstructor` for when the provided
values are Functions but not wrapped with `allowInterop`.
Adds a test to check for assertions in each of those methods.

Change-Id: I7681cf81170d7975abc7e7dd4172f2c5673f203b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176740
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-12-29 22:29:05 +00:00
Srujan Gaddam df7473e6e2 Filter out tests that use eval in csp
Filters out recently added js_interop_constructor_name tests
and adds missing filtered test mock_test to lib_2.status.

Change-Id: I4607128b5e5266294f2bf393033587c26342ca24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177140
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-12-28 22:05:04 +00:00
Srujan Gaddam c7b6e6aa99 [dart:html] Change js_interop_constuctor_name tests to use namespace
These tests test to make sure that @JS interop classes can have the
same name as native classes but in a separate namespace. Since there
now exists a static error for @JS classes that have the same name as
a @Native class, the class is defined in a separate namespace. This CL
also refactors some of the code to avoid duplication and removes html
files in favor of `eval`.

Change-Id: I5cbba7e4b49ea726234fc86848638cac6ad8065b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176200
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-12-24 00:00:46 +00:00
Srujan Gaddam bc43d06479 [pkg:js] Add errors for JS interop using @Native classes
Closes https://github.com/dart-lang/sdk/issues/44211

- Preprocesses and hashes Native classes defined in the sdk.
- Adds an error if you use a JS class with the same underlying name
as a Native class.
- Adds tests with different namespaces to test for the error.

Change-Id: I649e8b2346de8cc6d11205941a37152ce42104b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175423
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-12-24 00:00:46 +00:00
Lasse R.H. Nielsen 478602ad79 Fix errors in Future implementation around Future<Future<X>>.
Previously, when completing a future with another future,
we always chained to the other future. This effectively awaits
the latter future and then completes the former with its result.
This is incorrect behavior if the former future is, say,
a `Future<Future<int>>` and the latter is a `Future<int>`.
In that case we *must not* await the latter future
because we can't complete the former future with an `int`.
We should just complete the future directly with the latter future
as a value.

We now check first whether to chain a `Future<T>` to another
future, and only does so if the latter future is a `Future<T>`
(or it's not a `T`, which shouldn't happen,
but currently does in some places).

Add test for behavior.

Change-Id: I57e27111c2fc7b7792dcf4ae9b7c1d5d504d0c0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/53602
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-12-14 16:34:28 +00:00
Srujan Gaddam b2b3fe155b Filter out lib/js/mock_test from csp
Bug: https://github.com/dart-lang/sdk/issues/42085

CSP policy disallows eval usage.

Change-Id: Icee740de9fa894a0b9fdd3a04795c0880db77e79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175586
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-12-10 18:28:57 +00:00
Srujan Gaddam 8e663541c9 [ddc] Change is checks for JS types
Changes 'is' checks for JS types such that it no longer does an
instance of check and instead only checks to see if the object
in question is a JS object or appropriate subtype. This means that
any two @JS objects will pass an is check and therefore can be
casted as one another. This makes it consistent with expected
behavior and dart2js.

Also amends the README to reflect the unified behavior.

Change-Id: I11aa105d6cafbbafde482b27dcc1182c0960cce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173140
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-12-10 01:38:26 +00:00
Srujan Gaddam 802d8b9835 Change js_mock_test to not use native types
js_mock_test currently tests mocks on native types by defining
the native types using JS interop. This is error-prone, as the
underlying native type has different type semantics than JS
interop types. Also moves these tests to lib/js and adds some
additional checks.

Change-Id: If4bba54d589a38d7f7fbf1c26c6c6f755ec6b9ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173361
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-12-10 01:38:26 +00:00
Stephen Adams 0b3288aca5 [tests] Fix some typed_data int64 tests
Change-Id: I8297649a09d33eeeba48cbd69f0e6fa115b28bec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175165
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-12-05 01:31:42 +00:00
Stephen Adams 708d969c1f Fix unmodifiable_typed_data_test
Change-Id: I6423add319d789cb7b7f081f9b440b7bcc642ca1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175161
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-12-04 23:46:42 +00:00
Stephen Adams 3205f60a75 Avoid shift in math/random_big_test
Change-Id: Ia9475b6aaa2c5bb7f93c98e0676f83ca7c3762b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175104
Auto-Submit: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-12-04 23:46:34 +00:00
Lasse Reichstein Holst Nielsen 8129c40c5e Update LinkedList.contains to take advantage of internal structure.
Made it explicit in the documentation that elements of the `LinkedList`
are compared using identity, not `operator==`, even if they choose to
override that.
The linked list entries are directly linked to their containing list,
which is what defined their containing list. Merely being equal to an entry
of a list does not make another entry belong to that list.

The `contains` method now simply checks that the `list` property of the
the provided entry is the list itself, which matches the existing behavior
of `remove`.

Fixes #44189.

Bug: https://github.com/dart-lang/sdk/issues/44189
Change-Id: Ia6a7fd461ddf18f99121662f87e83415746e1ca4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172161
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-02 14:08:08 +00:00
Martin Kustermann 7837c384c0 [vm/concurrency] As preparation step to sharing JITed code, disable various optimizations
This is a preparation CL to enable actually sharing JIT'ed code between
isolates within the same isolate group.

We start with conservative settings, disabling various compiler
optimisations. We will lift those restrictions step-by-step.

Since this is guarded by FLAG_enable_isolate_groups it will not affect
any production code. Only individual tests which opt-in via the flag.

TEST=Existing tests opt'ing into --enable-isolate-groups.

Issue https://github.com/dart-lang/sdk/issues/36097

Change-Id: I05c4151116a8516f92c76b4d57f2c7fb725168ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173970
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-11-26 15:08:35 +00:00
Srujan Gaddam 66291547cd [pkg:js] Add tests for classes that implement JS interfaces
Tests that Dart, JS, and anonymous classes can implement each others'
interfaces. Note that only getters are used to test the interface to
avoid bloating the test.

Change-Id: Ica3c633ed35eb29c81103a6c5ea79a52bcfc6a84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172481
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2020-11-18 01:22:39 +00:00
Srujan Gaddam 4cd0926703 [package:js] Add/modify tests for JS interop subtyping
Adds some basic tests to check for runtime subtyping with JS
interop types. Uses function types only to check for subtyping
relationships. Extends some tests on is and as checks as well.

Change-Id: I9cbc91d0c475fba3213dd9a3443921232c286804
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170660
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-11-11 19:28:13 +00:00
Lasse Reichstein Holst Nielsen 1003e91a35 Remove uses of, and need for, Expect.throwsNullCheckedError.
All code which was tested now throws a TypeError in both
sound and unsound null safe mode.

Change-Id: I304dfa6b8683223562f8613f3d14823fccab35bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170439
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-11-11 13:30:30 +00:00
Erik Ernst 3a7eeb6315 Rename is{Strong,Weak}Mode to has{Sound,Unsound}NullSafety
Change-Id: If3912d75c5f89a741299b2fae4299d01ac928eec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170424
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-11-05 14:26:53 +00:00
asiva 308c8059f3 [Tests] - Fix the spawnuri autodetect tests.
TESTS = existing tests are being fixed here

Change-Id: I9136017d29c11f73dd97c82364dc5ead8e2ae7d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169407
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-11-04 17:50:27 +00:00
Alexander Markov 0b3e6bd16c [vm] Enable non-nullable experiment in the VM by default
VM was not performing auto-detection of sound null safety mode
if --enable-experiment=non-nullable was not specified on the command
line. This change flips that logic to perform auto-detection unless
--enable-experiment=no-non-nullable is specified.

TEST=Added regression test runtime/tests/vm/dart/regress_44026_test.dart.

Fixes https://github.com/dart-lang/sdk/issues/44026
Fixes https://github.com/dart-lang/sdk/issues/44043

Change-Id: Ide8935e90dd3a8bd5a417aeb758605dedbb853eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170201
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-11-03 22:29:08 +00:00
Liam Appelbe f25c50fdcb [wasm] Use wasm traps to handle exceptions
The Dart exception is converted to a string, stored in a trap which
is passed through wasm, then converted back to a Dart exception.

Module instantiation can also throw a trap, because it internally
invokes the initialization function, if the module defines one. So I'm
handling this too.

Also, update to the new version of the wasm C API, which replaces some
foo_t** with foo_vec_t*.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I1e6952a191134734a892c42b2fb8ba3506bb0844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169784
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-11-02 23:32:20 +00:00
Leaf Petersen a6faf8f2f9 [Language] Enable null safety in Dart 2.12.
Closes https://github.com/dart-lang/sdk/issues/22

Change-Id: I662dd17fda0ff62a871314896fbf1dbe220f41de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166790
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2020-10-29 18:25:56 +00:00
Srujan Gaddam ed009afc4c [package:js] Add static errors for invalid extends
Bug: https://github.com/dart-lang/sdk/issues/37896

dart2js disallows JS interop classes from extending Dart classes,
and ddc does not work as expected. Dart classes that extends JS
interop classes can't be declared in ddc and throw an error on
usage in dart2js. This CL adds static errors for both cases.

Change-Id: I72001d2e8bec046c0e1ab4c06fed8fcf84ade259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164840
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-10-28 16:04:15 +00:00
Liam Appelbe e2840ed07a [wasm] Basic WASI support.
Enabling WASI when building an instance sets up the default WASI
imports, and can optionally capture stdout/stderr. I'd like to set up
something similar for stdin, but Wasmer doesn't support that yet.

I also improved error handling in WasmRuntime by adding Wasmer's last
error to the thrown exceptions where appropriate.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I2d8546e878bcb43c7093490eac085aa62d318e96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167904
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-10-20 19:24:05 +00:00
Liam Appelbe 89dbc35fca [wasm] Wasm function imports.
I switched from a WasmImports object to a builder pattern:
module.instantiate().addMemory(...).addFunction(...).build();

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I381aa0f7df1fa006ce8d051cd5b4a1bcc1835e46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167460
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-10-16 23:16:42 +00:00
Lasse R.H. Nielsen a15025fc85 Harden StreamIterator against out-of-order events.
Users have seen event being sent *during* the `listen` call
to the underlying stream. This caught the `StreamIterator`
in an unanticipated state (subscription wasn't available yet).

Sending events during a `listen` call can currently happen
using a synchronous broadcast stream controller adding
events in the `onListen` callback.
That should be fixed so that broadcast stream subscriptions
are treated as paused during the `onListen` call like
single-subscription streams already are.

This change hardens the class against that particular malpratice,
but it's still possible to get into inconsistent states if the
`listen` call somehow manages to call back into the same
stream-iterator again. So, don't do that.

(The class also assumes that no stream will send events/call callbacks
* while paused.
* after cancelling
* after a done event
* while delivering another event.

If a stream does so, things will still crash.
It is believed that no platform stream will do any of these.)

Fixes #43779.
BUG= http://dartbug.com/43779

Change-Id: If47065cfa9a1115425fdf51b147f2ed7154fef99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167800
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-10-16 20:20:02 +00:00
Srujan Gaddam 5a28f14a25 [package:js] Add test for inheritance between classes
Adds a test to verify that JS interop and anonymous classes can
properly extend one another and that member access behaves as
expected.

Change-Id: I98b77444363ec3f985a9a10f3716e15a7fd970f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164882
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-10-15 23:15:11 +00:00
Alexander Markov 89ee3c8e2a [test] Fix lib/mirrors/library_uri_io_test to pass when running not from source
This test was assuming that Platform.script would be equal to library
URI, but this is not the case when running from a dill file or a
snapshot.

Change-Id: I0ff2249b5b5301d6463ceca48097df7cb64e78b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167501
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-14 00:54:17 +00:00
Alexander Markov 18b2f6db03 [test] Fix lib/isolate/no_package_test for Windows
The test was using file path as an URI, which is not correct on
Windows.

Change-Id: I097821a1090016994baf7bab66440ca83a58564f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167500
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-13 23:56:50 +00:00
Liam Appelbe cff78bed87 Reland "Switch wasmer FFI boilerplate to new API"
This reverts commit 0c3d3da6ce.

Un-deleting the LICENSE file, to fix the dart->flutter roller.

Change-Id: Iee44c24e7cdb5c03f4ae131d08451fae2e996f49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167201
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-10-13 19:30:58 +00:00
Alexander Aprelev 0c3d3da6ce Revert "Switch wasmer FFI boilerplate to new API"
This reverts commit 9d0ae7d017 as it broke dart->flutter roller's flutter license script.

Change-Id: If523b9b88631e1eca0fef3612387005921481222
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166981
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-10-10 05:56:29 +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
Liam Appelbe 9d0ae7d017 Switch wasmer FFI boilerplate to new API
Broadly speaking, the new API is very similar to the old one. The only
public facing change is that you can't make a memory by itself anymore.
You need to construct if from a store, which is owned by a module.

The new API no longer passes structs by value, so I was able to delete
the wasmer_wrapper.cc, and the files I had copied from the wasmer repo.

The new API is also a lot more verbose, so it made more sense to write
a script to generate the FFI boilerplate, rather that write it all
manually.

All the migrated tests that were passing before this refactor are still
passing.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I52ca54b982a27f1d851c630d3e09833b8810060c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164081
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-10-09 19:43:57 +00:00
Alexander Markov 34e8b4229e [tests/nnbd] Mark test as slow in debug mode, add diagnostics
Issue: https://github.com/dart-lang/sdk/issues/43613
Change-Id: I12fe82b3dc2eced6e0c582ecc487ef140e5edc40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165365
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-07 02:01:23 +00:00
Alexander Thomas 44cfc9a05a [testing] Skip isolate/detect_nullsafety_2_test on Windows
https://github.com/dart-lang/sdk/issues/43583

Change-Id: I4d25013f2c92904854085349423254979687837b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165162
Reviewed-by: William Hesse <whesse@google.com>
2020-09-30 08:35:37 +00:00
Alexander Thomas c3d37c1ad6 [infra] Add additional nnbd VM builders
See also Luci configuration here:
https://dart-review.googlesource.com/c/sdk/+/164084

https://github.com/dart-lang/sdk/issues/43463

Change-Id: I071c8c6055004574cbe35f14a28e0cd8c468988f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164164
Reviewed-by: William Hesse <whesse@google.com>
2020-09-29 09:57:44 +00:00
Srujan Gaddam c990450628 [package:js] Add checks for external keyword
Checks to see if a JS interop member is correctly annotated with
the `external` keyword. If it is not, it must be one of several
exceptions to be allowed.

This CL also changes static errors to first check for `JS` and
`external` before processing the member as a JS interop member.
This makes it clearer whether a member is a JS member.

Change-Id: I412eeafbfe8773847bfb9c864e4fb9b65e2d632a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158083
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-25 23:30:34 +00:00
Lasse R.H. Nielsen 02923c6f83 Make Future.wait not return a const <Never>[] when given no futures.
Fixes #43445.

Bug: https://github.com/dart-lang/sdk/issues/43445
Change-Id: I70f722f6bee1d4cfe4d53a5f37bc29f0751edd78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164162
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-09-25 10:37:00 +00:00
Mayank Patke 5be3a355e7 [dart2js] Clean up --experimental-trust-js-interop-type-annotations
flag.

Change-Id: I8622e88afdd1fc3f65f36814eebc8e124de2bc25
Fixes: https://github.com/dart-lang/sdk/issues/43470
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164422
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-25 00:17:09 +00:00
Liam Appelbe cc8fd04924 [wasm] Add WasmMemory class.
Also, port the old wasm memory tests, and fix some NNBD issues.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I131ba5836bb0a3dd946cf9b0fa3f2e186b6b132e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162801
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-09-16 19:24:28 +00:00
Liam Appelbe 56be9a7425 [wasm] Port about half of the old dart:wasm tests to package:wasm
The rest of the tests rely of features I haven't implemented yet. I'll
port them as I implement them.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I3465f10055db8d82148004ea975c0ed3b2928178
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162780
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-09-15 20:48:31 +00:00
Robert Nystrom 2f1ad1e929 Fix lib/mirrors/library_uri_package_test.
It was importing the args package which has not yet been migrated to
null safety in the SDK repo. It uses that package mostly arbitrarily
so I switched it to use expect instead.

Change-Id: I1550a830a157c376219ebb64c97f3a329af6e75b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162802
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-09-15 00:53:48 +00:00
Srujan Gaddam 28b8cb34d3 [dart:html] Unify shared attribute metadata from MDN
browser-compat-data includes info on elements as both part of the
Web API and the individual tagged elements. The scripts would default
to whatever was processed last instead of trying to unify any conflicts
that may come up with the different sources of truth. This CL addresses
that issue by choosing the "stricter" of the two versions.

Change-Id: Id3437c14276faf8af3fe41d7a6eb83defc9bd0b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155844
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-25 23:48:43 +00:00
Lasse Reichstein Holst Nielsen 0d322488ae Fix bug in Stream.multi.
The sync operations on a MultiStreamController did not check whether
sending events at the current time was allowed.
That could lead to `null` dereferencing errors when doing operations
on the controller after a cancel, and could cause events to appear
out of order.

Change-Id: I06b86a78959dfcaa402f74e2980a9d515f097dc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159442
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-08-21 09:53:10 +00:00
Srujan Gaddam f20b0ddcc2 [package:js] Remove stale TODOs from static error tests
Closes https://github.com/dart-lang/sdk/issues/43022

Real static errors were added in a previous CL. This simply removes
TODOs to address that and removes a TODO to handle contexts. Static
error testing doesn't support testing for contexts.

Change-Id: Id27fadeb77484a3556fdfdf4c50c8cd67ce2d9a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159381
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-08-19 22:04:58 +00:00
Mayank Patke 41953c8835 [dart2js] Rewrite lib/html/js_typed_interop_type_test to use external
fields.

This brings it more in line with the lib_2 version.

Change-Id: I99e4f6a467fa5b58d6e7c5206e1f6d9956fc60bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158961
Auto-Submit: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-18 15:46:20 +00:00
Clement Skau eb4cf54d9a [Nit] Fixes typo in package_config_test (x2)
Change-Id: I5c0dff5be33d8653e66ea5ace526666de7a8bf95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158541
Reviewed-by: Andrei Constantinescu <andreicostin@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-08-14 14:02:39 +00:00
Robert Nystrom 1c5d3dfd4a Run web static error tests on dart2js and DDC and validate output.
If a static error test contains "[web]" error markers, this runs them
on DDC and dart2js, parses the output, and tests that the compilers
report the expected errors.

Change-Id: I8b846f75828a0078f61c2fc1f3da0a4a587349cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158100
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-08-12 23:15:38 +00:00
Srujan Gaddam e51623f81a [package:js] Add errors for missing @JS on class
Adds errors for class members that have a @JS annotation but the
enclosing class does not.

Change-Id: Id693af71678510047a723863846d89aa29cebe26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157004
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-07 17:09:23 +00:00
Mayank Patke 36559e6c0c [dart2js] Update lib/html/js_typed_interop_type_test to use external
getters instead of final fields.

See discussion at #42955.

Change-Id: If8bb92f39eda2ee2cdb45e1eb07f1ef379ed0af3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157478
Auto-Submit: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-06 20:48:29 +00:00
Mayank Patke fcd88b5b6d [dart2js] Remove late from final fields in
lib/html/js_typed_interop_type_test.

Also update the error produced when an interop type contains a
non-external member in case users run into it via a late field.

Change-Id: I5968f4c8b3a71a3d467412c4499524ec4cc9d838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157161
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-08-05 23:40:05 +00:00