Vijay Menon
a67db4cd1e
Remove failures
...
Weird - passing now. Maybe some flakiness in our test framework?
TBR=jmesserly@google.com ,rnystrom@google.com
Review-Url: https://codereview.chromium.org/2971193002 .
2017-07-06 10:06:54 -07:00
Jennifer Messerly
5533a256cb
fix #30030 , fix #27327 - fix tearoffs and various Object member bugs
...
this includes various cleanups found along the way:
* various issues with JS annotations, see #30043
* getGenericClass is now optimized when used in a JS builtin with a Type literal
* typed list literals should be slightly faster to create
* memoized getters used by dart:_runtime should be faster
* registerExtension should be a tad faster, and now understands JSArray
* dart.bind "safeName" hack gone in codegenerator
* JSArray<E>.runtimeType returns List<E>
* JSArray<E>.noSuchMethod works
* cleans up code that generates `setExtensionBaseClass` (used only by JSArray)
* _throwUnsafe helper for generating a `throw` in --unsafe compile mode
* fix tearoff of JS interop types (_emitSimpleIdentifier)
* fix TODO about splitting LazyJSType and AnonymousJSType
* fix is/as/cast methods on TypeRep and related classes
* fix codegenerator to not tearoff "hashCode" and "runtimeType" (they are not methods)
* fix NoSuchMethodError.toString() (update via dart2js sdk impl)
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2962263002 .
2017-07-05 14:17:53 -07:00
Bob Nystrom
52a9e3d9c6
Fix build_pkgs.dart to not mutate arguments list. ( #30078 )
...
* Fix build_pkgs.dart to not mutate arguments list.
Also remove build of when package since it's apparently gone now.
* Use sublist to remove element.
2017-07-05 12:20:58 -07:00
Vijay Menon
7b766556a1
Update test status
...
See #30075
TBR=rnystrom@google.com
Review-Url: https://codereview.chromium.org/2967193002 .
2017-07-05 10:16:25 -07:00
Vijay Menon
9cbd5bdc2e
Output errors for tests that fail to compile
...
This makes it easier to fix strong mode errors in tests.
R=rnystrom@google.com
Review-Url: https://codereview.chromium.org/2971443002 .
2017-07-05 09:37:14 -07:00
Leaf Petersen
6f73694bb7
Generate better code for '==', core.identical, and dart.test.
...
Avoid falling back to the dart.equal runtime helper where possible based on static types. Also uses JS `==` or `===` in some cases.
Treat core.identical as a compiler intrinsic, based on type.
Make dart.test assume correct types, use dart.dtest for combined cast and nullability check only when required.
Fixes https://github.com/dart-lang/sdk/issues/29851
Fixes https://github.com/dart-lang/sdk/issues/29772
BUG=
R=jmesserly@google.com
Review-Url: https://codereview.chromium.org/2926613003 .
2017-06-30 15:04:29 -07:00
Bob Nystrom
24743461c9
Fix test.sh to not run non-existent shell script.
...
R=leafp@google.com
Review-Url: https://codereview.chromium.org/2964123002 .
2017-06-29 17:25:17 -07:00
Leaf Petersen
24f9478550
Fix handling of inline JS types in DDC.
...
DDC was incorrectly interpreting inline JS types, and hence marking
some things as non-nullable which were nullable. This fixes that, and
also slightly improves the analyzers treatment of inline JS types.
Also fixes some incorrect inline JS type annotations in DDC patch
files.
BUG=
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2965633002 .
2017-06-29 16:02:04 -07:00
Bob Nystrom
0b2c9b048d
Dynamically load packages for dartdevc tests in test.dart.
...
This involves a few pieces:
- Add support to DDC for specifying the module name associated with a
given summary. This lets test.dart invoke DDC using summaries in the
build directory outside of the directory containing the test itself.
- Add support to the build scripts for building the packages. This adds
a new GN target that builds everything needed to run test.dart with
dartdevc. In particular, it invokes build_pkgs.dart to compile the
relevant packages to JS+summary so that the tests can use them.
This requires some changes to build_pkgs.dart so it can output to a
given directory.
- In test.dart, when tests are compiled with dartdevc, pass in the
summaries for the packages so they don't get compiled in. Then, when
the test is run, configure require.js with the right paths to their
JS files so they can be loaded.
I also removed a bunch of unneeded buildDir parameters being passed
around the various CompilerConfiguration class methods now that they
have direct access to the configuration.
Fix #29923 .
R=vsm@google.com , whesse@google.com , zra@google.com
Review-Url: https://codereview.chromium.org/2955513002 .
2017-06-29 13:45:57 -07:00
Jennifer Messerly
94af6bf093
fix #29733 , handle variables that completely shadow parameters
...
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2961863003 .
2017-06-29 10:39:09 -07:00
Vijay Menon
e84fd776cb
Improve runtime error when a module is not loaded
...
R=alanknight@google.com
Review-Url: https://codereview.chromium.org/2959323002 .
2017-06-29 08:09:26 -07:00
Devon Carew
83d9e3fc91
Fix a few unused imports and symbol warnings.
...
BUG=
R=messick@google.com
Review-Url: https://codereview.chromium.org/2961013002 .
2017-06-28 09:44:38 -07:00
Vijay Menon
fd6164cce4
Handle toString on DOM types
...
R=jmesserly@google.com
Review-Url: https://codereview.chromium.org/2952363003 .
2017-06-27 09:22:25 -07:00
Erik Corry
029b1cb948
Spelling fixes e to i.
...
R=kevmoo@google.com
BUG=
Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Vijay Menon
daf960d5a4
Fix Object method tearoffs
...
R=jmesserly@google.com
Review-Url: https://codereview.chromium.org/2953933002 .
2017-06-22 15:59:45 -07:00
Vijay Menon
7d73159017
Fix ddc build
...
Not sure why this just started breaking. I don't think Ben added this
param - just a use of it. Our patch script might not be catching the
mismatch.
TBR=jmesserly@google.com ,bkonyi@google.com
Review-Url: https://codereview.chromium.org/2954513003 .
2017-06-22 14:27:22 -07:00
Jennifer Messerly
635d95fccf
cleanup unused useDisplayName parameter
...
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2953883002 .
2017-06-22 14:17:44 -07:00
Vijay Menon
febded6052
Fix mocked operator methods
...
R=jacobr@google.com
Review-Url: https://codereview.chromium.org/2949123002 .
2017-06-21 16:54:08 -07:00
Vijay Menon
ecca1e1c2a
Add FallThroughError patch
...
TBR=jensj@google.com ,rnystrom@google.com
Review-Url: https://codereview.chromium.org/2953693002 .
2017-06-21 16:33:31 -07:00
Jennifer Messerly
070f31a899
optimize null safe ops by using DDC's let abstraction
...
We were already using it for most other things (increment ops, op assign, ??, cascades, etc)
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2944413002 .
2017-06-20 10:31:30 -07:00
Vijay Menon
ed8de04f08
Fixes for super tearoff in constructor
...
Fixes #29932
R=jmesserly@google.com
Review-Url: https://codereview.chromium.org/2944003003 .
2017-06-19 13:39:53 -07:00
Jennifer Messerly
93a02bf8f9
fix super setters when super is not allowed
...
We were generating these incorrectly. This also improves the code structure around super helpers as well as accessors vs fields.
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2940323003 .
2017-06-16 11:49:51 -07:00
Jennifer Messerly
c848476643
fix super from constructors
...
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2938713002 .
2017-06-13 16:47:20 -07:00
Jennifer Messerly
1f50f0d126
fix mixins with factory constructors
...
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2935933005 .
2017-06-13 15:58:50 -07:00
Alan Knight
9e3fdbf94d
Update DDC core patch for ConstantExpressionError
...
BUG=
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2941593002 .
2017-06-13 13:57:42 -07:00
Jennifer Messerly
71c7914061
fix checking of dsend generic type bounds
...
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2935553002 .
2017-06-12 16:17:39 -07:00
Jennifer Messerly
cb038cda2f
fix test runner to understand mutlitests that expect an error
...
R=rnystrom@google.com , vsm@google.com
Review-Url: https://codereview.chromium.org/2930203002 .
2017-06-12 16:07:17 -07:00
Jennifer Messerly
e79fbd167b
fix #29789 , avoid unneccessary dcalls and checks in dart:_runtime
...
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2932043003 .
2017-06-12 15:44:45 -07:00
Jennifer Messerly
334354f968
fix #29753 , use ES5 constructors for ddc
...
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2934623003 .
2017-06-12 15:31:32 -07:00
Vijay Menon
06c4619b3e
Fix int test
...
Fixes #29822
R=jmesserly@google.com
Review-Url: https://codereview.chromium.org/2927703005 .
2017-06-08 17:42:35 -07:00
Vijay Menon
a7645f817f
Optimize runtime code on hot methods
...
ochafik: this should include your internal fixes.
Here are generated diffs:
JSArray:
[dartx._get](index) {
- if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
- if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
+ if (index == null || index >= this.length || index < 0) {
+ dart.throw(_js_helper.diagnoseIndexError(this, index));
+ }
return this[index];
}
[dartx._set](index, value) {
E._check(value);
this[dartx.checkMutable]('indexed set');
- if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
- if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
+ if (index == null || index >= this.length || index < 0) {
+ dart.throw(_js_helper.diagnoseIndexError(this, index));
+ }
R=jmesserly@google.com , ochafik@google.com
JSString:
[dartx.codeUnitAt](index) {
- if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
- if (dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
- if (dart.notNull(index) >= dart.notNull(this[dartx.length])) dart.throw(_js_helper.diagnoseIndexError(this, index));
+ if (index == null || index < 0 || index >= this.length) {
+ dart.throw(_js_helper.diagnoseIndexError(this, index));
+ }
return this.charCodeAt(index);
}
[dartx.startsWith](pattern, index) {
if (index === void 0) index = 0;
- _js_helper.checkInt(index);
- if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this[dartx.length])) {
+ let length = this.length;
+ if (dart.notNull(index) < 0 || index > length) {
dart.throw(new core.RangeError.range(index, 0, this[dartx.length]));
}
if (typeof pattern == 'string') {
let other = pattern;
- let otherLength = other[dartx.length];
- let endIndex = dart.notNull(index) + dart.notNull(otherLength);
- if (endIndex > dart.notNull(this[dartx.length])) return false;
+ let otherLength = other.length;
+ let endIndex = index + otherLength;
+ if (endIndex > length) return false;
return other == this.substring(index, endIndex);
}
return pattern[dartx.matchAsPrefix](this, index) != null;
}
get [dartx.isEmpty]() {
- return this[dartx.length] == 0;
+ return this.length == 0;
}
[dartx.compareTo](other) {
- if (!(typeof other == 'string')) dart.throw(_js_helper.argumentErrorValue(other));
+ if (other == null) dart.throw(_js_helper.argumentErrorValue(other));
return dart.equals(this, other) ? 0 : this < other ? -1 : 1;
}
get [dartx.hashCode]() {
let hash = 0;
- for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
+ let length = this.length;
+ for (let i = 0; i < length; i++) {
hash = 536870911 & hash + this.charCodeAt(i);
hash = 536870911 & hash + ((524287 & hash) << 10);
hash = hash ^ hash >> 6;
...
}
[dartx._get](index) {
- if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
- if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
+ if (index == null || index >= this.length || index < 0) {
+ dart.throw(_js_helper.diagnoseIndexError(this, index));
+ }
return this[index];
}
Review-Url: https://codereview.chromium.org/2927763004 .
2017-06-08 17:31:44 -07:00
Ben Konyi
033c18472d
Revert "Removed SecurityContext.alpnSupported, as ALPN is now supported on all platforms. Also updated CHANGELOG.md to announce its removal."
...
This reverts commit 4b6fa0d5fb .
BUG=
R=kevmoo@google.com
Review-Url: https://codereview.chromium.org/2928013002 .
2017-06-08 14:32:41 -07:00
Ben Konyi
4b6fa0d5fb
Removed SecurityContext.alpnSupported, as ALPN is now supported on all platforms. Also updated CHANGELOG.md to announce its removal.
...
BUG=
R=zra@google.com
Review-Url: https://codereview.chromium.org/2926153004 .
2017-06-07 15:15:58 -07:00
Leaf Petersen
cb8cc2526b
Add codegen test for equality.
...
Adds a DDC test tracking the generated code and its correctness. Some
test harness changes to support running codegen tests.
BUG=
R=jmesserly@google.com
Review-Url: https://codereview.chromium.org/2930733002 .
2017-06-07 12:42:30 -07:00
Jennifer Messerly
332b34aba8
refactor _emitFunctionBody slightly to simplify it
...
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2929503002 .
2017-06-06 15:58:55 -07:00
Jennifer Messerly
99d5344463
fix "unresolved names" code generation
...
now unsafe-force-compile will generate a throw rather than a free floating name
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2920223009 .
2017-06-06 15:53:30 -07:00
Vijay Menon
b45e9e2de9
Minor tweak on README
...
Making the description on constructors more accurate.
R=jmesserly@google.com
Review-Url: https://codereview.chromium.org/2923123003 .
2017-06-06 10:39:31 -07:00
Leaf Petersen
671091b9ef
Regenerate DDC SDK.
...
BUG=
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2926523002 .
2017-06-05 16:28:16 -07:00
Vijay Menon
532d9eabc7
Update DDC Readme
...
R=rnystrom@google.com
Staging: https://github.com/dart-lang/sdk/blob/ddc-readme/pkg/dev_compiler/README.md
Review-Url: https://codereview.chromium.org/2920373002 .
2017-06-05 15:04:09 -07:00
Jennifer Messerly
3054dc50c1
fix #27255 , remove angular whitelist hack
...
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2928483002 .
2017-06-05 14:52:55 -07:00
Jennifer Messerly
88510c1860
fix #29146 , downgrade import error to warning in strong mode
...
R=brianwilkerson@google.com
Review-Url: https://codereview.chromium.org/2916223002 .
2017-06-01 15:44:30 -07:00
Devon Carew
a7c3358378
Remove an unused symbol analysis warning.
...
BUG=
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2911983009 .
2017-05-30 18:06:11 -07:00
Alan Knight
a865f0ecf2
Update DDC libraries to match SDK, and debugger_test golden file
...
BUG=
R=jacobr@google.com
Review-Url: https://codereview.chromium.org/2903333002 .
2017-05-25 15:00:51 -07:00
Vijay Menon
75afaf5a24
Support reflectClass on parameterized classes
...
Internal pageloader usage hits this.
R=rnystrom@google.com
Review-Url: https://codereview.chromium.org/2899343004 .
2017-05-25 13:27:35 -07:00
Vijay Menon
570f6de05b
Remove unsafe flag from ddc sdk
...
One small step for man...
R=rnystrom@google.com
Review-Url: https://codereview.chromium.org/2910473002 .
2017-05-25 10:50:17 -07:00
Alan Knight
0bb2d5e548
Update DDC html libraries to match SDK
...
BUG=
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2899083007 .
2017-05-25 09:33:23 -07:00
Vijay Menon
2187f5232d
DDC cleanup
...
R=jacobr@google.com , jakemac@google.com
Review-Url: https://codereview.chromium.org/2902103005 .
2017-05-24 13:01:10 -07:00
Alan Knight
b4b02daade
Include DDC fixes to dart:html in the main version
...
BUG=
R=jacobr@google.com , vsm@google.com
Review-Url: https://codereview.chromium.org/2899173002 .
2017-05-24 12:49:13 -07:00
Vijay Menon
5919a12038
Library root fix for win
...
R=jakemac@google.com
Jacob: do we need a fix in jsDebuggingLibraryName too? could that code be refactored - it looks like it duplicates a lot of logic.
Review-Url: https://codereview.chromium.org/2899363002 .
2017-05-24 12:10:47 -07:00
Vijay Menon
6402ad477d
Use the dart2js patch for dart:convert to get latest type fixes
...
BUG=
R=floitsch@google.com
Review-Url: https://codereview.chromium.org/2896253003 .
2017-05-24 07:33:19 -07:00