Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Unified Diff: sdk/lib/_internal/lib/core_patch.dart

Issue 418223010: Revert "Library functions can never be constructors." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | sdk/lib/_internal/lib/js_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/core_patch.dart
diff --git a/sdk/lib/_internal/lib/core_patch.dart b/sdk/lib/_internal/lib/core_patch.dart
index 6d829fa0fcb01d8e89ebb5f7bdb60072a7cb4fcb..b6f538ffec9700b8d3e709384b5d42b256ae2fce 100644
--- a/sdk/lib/_internal/lib/core_patch.dart
+++ b/sdk/lib/_internal/lib/core_patch.dart
@@ -228,18 +228,19 @@ class Stopwatch {
static int _now() => Primitives.timerTicks();
}
+class _ListConstructorSentinel extends JSInt {
+ const _ListConstructorSentinel();
+}
+
// Patch for List implementation.
@patch
class List<E> {
@patch
- factory List([int length]) = List._;
-
- factory List._([length = const ListConstructorSentinel()]) {
- if (length == const ListConstructorSentinel()) {
+ factory List([int length = const _ListConstructorSentinel()]) {
+ if (length == const _ListConstructorSentinel()) {
return new JSArray<E>.emptyGrowable();
}
- int typeCheckedLength = length;
- return new JSArray<E>.fixed(typeCheckedLength);
+ return new JSArray<E>.fixed(length);
}
@patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | sdk/lib/_internal/lib/js_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698