Commit Graph

11 Commits

Author SHA1 Message Date
Stephen Adams 9b185051a9 Don't use lazy static initializer in Random.secure()
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>
2019-03-15 17:45:06 +00:00
Jenny Messerly 1ef4399df0 Run dartfmt --fix for dart2 on pkg/dev_compiler
This uses optional new/const and `=` in named argument defaults.

All changes are automated, except for:

- utils/dartdevc/BUILD.gn: run DDC build scripts with --preview-dart-2
- pkg/dev_compiler/tool/patch_sdk.dart: add a TODO that Analyzer doesn't
  supporting implicit const in libraries.dart
- pkg/dev_compiler/tool/input_sdk/libraries.dart: was not formatted due
  to the aforementioned Analyzer bug
- tools/bots/test_matrix.json: run DDC sourcemap suite in Dart 2 mode
- pkg/pkg.status: skip pkg/dev_compiler if running in Dart 1 mode

Change-Id: I9b80ccba0c2cc7b66efc662a0b16562e3660aee3
Reviewed-on: https://dart-review.googlesource.com/60402
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2018-06-15 00:28:13 +00:00
Leaf Petersen 1b8f4ac1e7 Optimize DDC private runtime library files.
Eliminate numerous type checks not needed in strong mode.  Use
private nullability annotations instead of inline JS to mark known
non-null variables, and to make the compiler generate null checks
for null checked variables. Use nullability annotations and code refactoring to
remove redundant null checks and to move checks out of loops.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2994203002 .
2017-08-23 10:28:45 -07:00
Bob Nystrom 4145a49503 Move Dart versions of math.min() and math.max() into VM patch file.
For DDC and dart2js, we call the corresponding JS function. This is
shorter and avoids a strong mode type error in the Dart implementation.

R=jmesserly@google.com, lrn@google.com

Review-Url: https://codereview.chromium.org/2858353003 .
2017-05-05 15:15:21 -07:00
Lasse R.H. Nielsen 7998f590b1 Update documentation on trignometric functions.
Fixes #17515
BUG= http://dartbug.com/17515
R=floitsch@google.com

Committed: https://github.com/dart-lang/sdk/commit/40220ec0766bb2b179d3623d3f298223df842279
Review-Url: https://codereview.chromium.org/2852053002 .
2017-05-03 09:49:14 +02:00
Florian Loitsch 05e0e1ea40 Revert trigonometric function updates.
The VM has a fingerprint on the function and failed during compilation.

Revert "Fix patch errors."

This reverts commit ff1d7488d9.

Revert "Update documentation on trignometric functions."

This reverts commit 40220ec076.

BUG=

Review-Url: https://codereview.chromium.org/2851163003 .
2017-05-01 16:06:56 +02:00
Florian Loitsch ff1d7488d9 Fix patch errors.
Review-Url: https://codereview.chromium.org/2853813002 .
2017-05-01 15:57:40 +02:00
Jacob Richman 9484ac8bdf Format all dart dev compiler files
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2752163002 .
2017-03-15 21:34:25 -07:00
Bob Nystrom 20e402c43d Fix type errors in math.min() and math.max().
Really, this works around them, but the workaround is all round better
code.

Remove the Dart implementations of min() and max() and just forward to
the JS ones. In DDC, all numbers are double, so the type checks to
handle them specifically aren't meaningful. Also, we don't need the
other special case checks in there to help dart2js optimize them.

R=vsm@google.com

Review URL: https://codereview.chromium.org/2386493003 .
2016-09-30 13:18:07 -07:00
Harry Terkelsen 382996f41c update dart:math
BUG=
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/1967773005 .
2016-05-12 09:03:11 -07:00
John Messerly 807d3b3b22 reorganize SDK inputs
it's all under input_sdk now:
  lib -> the lib folder
  private -> the dart:_* libs
  patch -> the files with @patch

I imagine we'll try and focus changes on the last two
2015-03-02 16:00:53 -08:00