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

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

Issue 57773002: Repro for OOM bug in test.dart (applies to r29345). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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
Index: dart/sdk/lib/_internal/lib/collection_dev_patch.dart
diff --git a/dart/sdk/lib/_internal/lib/collection_dev_patch.dart b/dart/sdk/lib/_internal/lib/collection_dev_patch.dart
index f7467fd72562765f3afdeafc9f0669ef60bc54d1..90482452162724b6885b5743154906e86853cce9 100644
--- a/dart/sdk/lib/_internal/lib/collection_dev_patch.dart
+++ b/dart/sdk/lib/_internal/lib/collection_dev_patch.dart
@@ -2,45 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'dart:_foreign_helper' show JS;
+import 'dart:_js_helper' show Primitives;
patch class Symbol implements core.Symbol {
patch const Symbol(String name)
: this._name = name;
}
-/**
- * This is the low-level method that is used to implement
- * [print]. It is possible to override this function from JavaScript
- * by defining a function in JavaScript called "dartPrint".
- */
patch void printToConsole(String line) {
- if (JS('bool', r'typeof dartPrint == "function"')) {
- // Support overriding print from JavaScript.
- JS('void', r'dartPrint(#)', line);
- return;
- }
-
- // Inside browser or nodejs.
- if (JS('bool', r'typeof console == "object"') &&
- JS('bool', r'typeof console.log == "function"')) {
- JS('void', r'console.log(#)', line);
- return;
- }
-
- // Don't throw inside IE, the console is only defined if dev tools is open.
- if (JS('bool', r'typeof window == "object"')) {
- return;
- }
-
- // Running in d8, the V8 developer shell, or in Firefox' js-shell.
- if (JS('bool', r'typeof print == "function"')) {
- JS('void', r'print(#)', line);
- return;
- }
-
- // This is somewhat nasty, but we don't want to drag in a bunch of
- // dependencies to handle a situation that cannot happen. So we
- // avoid using Dart [:throw:] and Dart [toString].
- JS('void', 'throw "Unable to print message: " + String(#)', line);
+ Primitives.printString('$line');
}
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | dart/sdk/lib/_internal/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698