Commit Graph

59 Commits

Author SHA1 Message Date
Stephen Adams 231de7d3c2 Int64 improvements
1. Avoid test for JavaScript vs VM
2. strengthen & and | masking to help infer uint31 types in tests

R=cbracken@google.com

Review URL: https://codereview.chromium.org/1520773002 .
2015-12-14 13:50:11 -08:00
Stephen Adams 7926e2630f Better errors for pkg/fixnum
Replace `new ArgumentError(x)` with `new ArgumentError.value(x)`.
Throw RangeError for bad radix arguments.

R=cbracken@google.com

Review URL: https://codereview.chromium.org//1184183006.
2015-06-19 12:35:07 -07:00
sra@google.com 609875aaa2 Int64 tweaks for better type infererence
In some programs Int64._l was inferred as possibly null.

BUG=
R=herhut@google.com

Review URL: https://codereview.chromium.org//950733002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43998 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-24 20:52:00 +00:00
jacobr@google.com 3a82813e87 Cleanup IntX to implement Comparable<FixNum> which is more descriptive than Comparable as it would be unsafe to attempt to sort an array with both int and FixNum.
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//875323002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43365 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 22:53:27 +00:00
sra@google.com 8abca9eb46 Bump pkg/fixnum version so we can pull r38680
R=kevmoo@google.com

Review URL: https://codereview.chromium.org//774463004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42203 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 04:03:58 +00:00
sra@google.com 30366cf249 Int64 tweaks for type inference
We can cause _l, _m and _h to be inferred by dart2js as a non-negative 31-bit int which leads to better code for shifts.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//404453002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38680 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 16:51:13 +00:00
kevmoo@google.com 7ebebc7d74 use proper notation for true, false, and null in doc comments
BUG= https://code.google.com/p/dart/issues/detail?id=16193
R=lrn@google.com

Review URL: https://codereview.chromium.org//140783013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31947 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-19 19:24:06 +00:00
kevmoo@google.com 97835dc3a6 pkg/unittest: added LICENSE
R=rnystrom@google.com

Review URL: https://codereview.chromium.org//135343002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31750 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-13 18:07:45 +00:00
dgrove@google.com 18ca7d0036 Re-land r29957 (add versions and constraints for packages and samples), with
SDK constraints bumped from 1.0.0 to 0.8.10+6 .

R=ricow@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org//62473002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29986 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-06 18:28:22 +00:00
ajohnsen@google.com 61f6c51990 Revert "add versions and constraints for packages and samples"
This is currently blocking us from testing samples.

BUG=
R=kasperl@google.com

Review URL: https://codereview.chromium.org//59513007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29960 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-06 09:09:18 +00:00
jmesserly@google.com 02638c5760 add versions and constraints for packages and samples
- all packages at 0.9.0, except "analyzer" which had a version already
- dependencies at ">=0.9.0 <0.10.0" except analyzer is ">=0.10.0 <0.11.0"
- sdk constraint ">=1.0.0 <2.0.0"

R=sigmund@google.com

Review URL: https://codereview.chromium.org//59763006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29957 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-06 03:27:58 +00:00
cbracken@google.com 8d55ace137 Eliminate deprecated Int32/Int64.fromInt() constructors
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//38113004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29202 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 20:17:12 +00:00
cbracken@google.com d520000fe9 Throw FormatException when Int32/Int64.parseRadix() encounters bad digit
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//34223002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29109 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 19:04:43 +00:00
cbracken@google.com 8e3a216f33 Added bitLength, clamp(), toDouble(), toSigned(), toUnsigned().
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//24388004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27862 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-25 00:02:28 +00:00
cbracken@google.com 0b68c45e9c Int32, Int64 default constructor now takes an optional int parameter.
Deprecated.fromInt().

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//24372002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27777 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-23 16:52:36 +00:00
sra@google.com 7b8bb93212 New divide uses local variables rather than many temporary objects.
Removing mutators allows Int64 to have final fields and an (internal) const constructor.

R=cbracken@google.com

Review URL: https://codereview.chromium.org//23541010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27588 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-18 01:02:20 +00:00
sra@google.com 15fc29db41 Fix assert in int64 and add test
Review URL: https://codereview.chromium.org//23490010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26816 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 20:52:07 +00:00
sra@google.com bed52fac0d More efficient Int64 parsing and printing.
This replaces code that generates lots of temporary Int64 objects with
code that works almost entirely usings SMI values in local variables.
Printing generates numbers several digits at a time.

Speedup is 10x for parsing and 100x for printing on dart2js and a little over 5x each on the VM.

Printing produces hex digits in the same case as int.toString.

R=cbracken@google.com

Review URL: https://codereview.chromium.org//23441004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26760 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 01:34:06 +00:00
kathyw@google.com 210edb7a54 Update meta and logging library descriptions; tweak fixnum
R=mcampione@google.com

Review URL: https://codereview.chromium.org//23220007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26562 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-22 22:17:10 +00:00
cbracken@google.com d352df8d05 Added fixnum package docs.
Original bug:
http://dartbug.com/7834

BUG=
R=kathyw@google.com

Review URL: https://codereview.chromium.org//23173002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26134 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-14 18:30:55 +00:00
cbracken@google.com 25ed5a4234 Clean up exceptions thrown in pkg/fixnum.
* Throw ArgumentError rather than string.
* Don't wrap ArgumentError params in strings.

Original Issue:
https://code.google.com/p/dart/issues/detail?id=9909

BUG=
R=justinfagnani@google.com

Review URL: https://codereview.chromium.org//21155004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25635 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 20:40:00 +00:00
cbracken@google.com 0bcf5eff82 Int32 constants should be const.
BUG=
R=justinfagnani@google.com

Review URL: https://codereview.chromium.org//21169002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25634 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 20:34:00 +00:00
cbracken@google.com 6a728556d1 Rename int{x,32,64} to Int{X,32,64} in line with naming guidelines.
BUG=
R=justinfagnani@google.com

Review URL: https://codereview.chromium.org//21085005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25584 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-29 21:19:59 +00:00
cbracken@google.com 79bd97594e Don't throw exception for non-integer args to fixnum int32,int64 op ==
Original bug
https://code.google.com/p/dart/issues/detail?id=12073

BUG=
R=justinfagnani@google.com

Review URL: https://codereview.chromium.org//20803006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25577 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-29 17:56:29 +00:00
cbracken@google.com 85462a9c08 Migrate fixnum tests to unittest. Fix int32 rollover bug.
- Migrated tests to unittest
- Reorganized tests by operator
- Test coverage for +/- overflow/rollover
- Test coverage for null args
- Test coverage for unary -
- Test coverage for comparison operators

BUG=
R=justinfagnani@google.com

Review URL: https://codereview.chromium.org//19669002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25176 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 20:44:47 +00:00
floitsch@google.com 8fd6d0aafd Remove Expect from core library.
Committed: https://code.google.com/p/dart/source/detail?r=19755
Reverted: http://code.google.com/p/dart/source/detail?r=19756

Review URL: https://codereview.chromium.org//12212016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20996 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 19:43:16 +00:00
nweiz@google.com c590e8ae0c Switch pkg packages, pub, and dartdoc to use package: imports.
This also changes the SDK layout by replacing the "pkg" directory, which
contained the full source of all the packages needed by pub and dartdoc, with a
"packages" directory that contains only their lib directories. This directory is
used as the package root for pub and dartdoc when run from the SDK.

BUG=6745

Review URL: https://codereview.chromium.org//12782016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20640 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-28 20:27:28 +00:00
floitsch@google.com cead1d41f1 ceil/floor/truncate/round return integers.
This CL supercedes https://codereview.chromium.org/11748016/

Review URL: https://codereview.chromium.org//12317107

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19810 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-11 18:54:37 +00:00
floitsch@google.com 5dc8107c53 Revert "Remove Expect from core library."
This reverts commit 19755.

Review URL: https://codereview.chromium.org//12743005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19756 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-09 03:19:07 +00:00
floitsch@google.com 12dbd2fd70 Remove Expect from core library.
Review URL: https://codereview.chromium.org//12212016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19755 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-09 02:40:37 +00:00
lrn@google.com 6b4f4b1bab Change new List(n) to return fixed length list.
Deprecate List.fixedLength, add List.filled.

Make Iterable.toList and List.from take "growable" argument,
defaulting to false.

Review URL: https://codereview.chromium.org//12328104

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19112 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 08:45:04 +00:00
lrn@google.com 3c0ac360e7 Remove deprecated string features.
Make String.codeUnits return a List.

Review URL: https://codereview.chromium.org//12282038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18960 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 10:48:09 +00:00
lrn@google.com bbfe7b02dc Reapply "Make Comparable generic."
Avoid concurrent modification in dart2js.
Avoid crash in VM by not using self-referential type bound.

Review URL: https://codereview.chromium.org//12288040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18667 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-19 10:29:44 +00:00
kasperl@google.com d4feeb4910 Revert "Make Comparable generic."
This reverts commit dd714db881a0ad63eaa1e5491e93dd8843eb5929.

R=lrn@google.com
BUG=

Review URL: https://codereview.chromium.org//12298027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18657 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-19 08:06:03 +00:00
lrn@google.com a0f22b77be Make Comparable generic.
It's now allowed to write "class X implements Comparable<X>" to make
X comparable only to X's. The argument type of Comparable<T>.compareTo
is now T.

Review URL: https://codereview.chromium.org//12255055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18655 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-19 07:52:24 +00:00
floitsch@google.com 4a7dfd2da3 Big merge from experimental to bleeding edge.
Review URL: https://codereview.chromium.org//11783009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16687 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 11:23:16 +00:00
rnystrom@google.com cef256ecf1 Convert the small packages in pkg to use "package:".
Review URL: https://codereview.chromium.org//11575043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16189 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-15 01:05:35 +00:00
dgrove@google.com 33abe0ef0a Add authors and homepages to packages.
Review URL: https://codereview.chromium.org//11418267

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15601 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 21:16:01 +00:00
lrn@google.com 22309b260c Remove NullPointerException.
Accessing non-existing members on null now throws NoSuchMethodError.
Throwing a null value fails by throwing a NullThrownError.
Methods checking for null now generally throw new ArgumentError(null).

Committed: https://code.google.com/p/dart/source/detail?r=15061

Review URL: https://codereview.chromium.org//11415028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15136 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 09:21:52 +00:00
lrn@google.com 0c8dce77f1 Revert "Remove NullPointerException."
Crashes in the x64 VM.

Review URL: https://codereview.chromium.org//11417058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15065 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 09:59:59 +00:00
lrn@google.com e211c2f0ee Remove NullPointerException.
Accessing non-existing members on null now throws NoSuchMethodError.
Throwing a null value fails by throwing a NullThrownError.
Methods checking for null now generally throw new ArgumentError(null).

Review URL: https://codereview.chromium.org//11415028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15061 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 08:51:49 +00:00
rnystrom@google.com 016676683a Update fixnum to new package guidelines.
BUG=

Review URL: https://codereview.chromium.org//11405003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14760 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-09 21:28:21 +00:00
gram@google.com 981c4b11df Restructure pkg/unittest and pkg/webdriver to follow the pub conventions.
This means all imports of unittest in our test code had to change to include 'lib' in the path.
While doing that change I changed the library/imports to the new syntax in the affected files.
Review URL: https://codereview.chromium.org//11301046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14443 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 23:09:47 +00:00
floitsch@google.com 27cadf2b66 isEven, isOdd, isNegative, isMaxValue, isMinValue, isInfinite, isPositive, isSingleValue.
Review URL: https://codereview.chromium.org//11227042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13974 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 16:15:36 +00:00
ahe@google.com 6254729761 Revert "Parts must start with 'part of'" and "Attempt to fix VM build"
This reverts r13961 and r13963.

Review URL: https://codereview.chromium.org//11233061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13967 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 14:24:04 +00:00
scheglov@google.com 50b5b6e1a8 Parts must start with 'part of'
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13961 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 13:20:50 +00:00
floitsch@google.com 9074fd0178 Make hashCode a getter and not a method.
Review URL: https://codereview.chromium.org//11191078

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13866 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 12:41:04 +00:00
lrn@google.com 37197c2553 Stop using the Hashable interface.
All objects have a hashCode method, so there is no need for a Hashable
interface.
The interface itself is retained for at least two weeks, to give time for
code to remove uses of it.

Review URL: https://codereview.chromium.org//10993059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12955 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 13:07:54 +00:00
lrn@google.com a1faa6f135 Change IllegalArgumentException to ArgumentError.
Review URL: https://codereview.chromium.org//10989013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12841 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 12:27:52 +00:00
lrn@google.com 26fab5183a Move parseInt parseDouble to int/double classes as a static method.
Remove math dependency from core/coreimpl in dart2js.
The existing Math.parseInt and Math.parseDouble are kept *for now*, but
simply redirect to the static methods.
They will be removed in time (when library code is ready for it).

Review URL: https://codereview.chromium.org//10913271

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12417 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-17 07:25:38 +00:00