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

Unified Diff: tools/dom/src/native_DOMImplementation.dart

Issue 35663003: Companion CL to support $0, $1, $2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: PTAL Created 7 years, 2 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/js/dartium/js_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/native_DOMImplementation.dart
diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
index f6c9e499177f8aede91d38478ab22dc78ab85b98..2a3a0e250197116781347de4dbbe4b096e59783c 100644
--- a/tools/dom/src/native_DOMImplementation.dart
+++ b/tools/dom/src/native_DOMImplementation.dart
@@ -167,6 +167,10 @@ class _Utils {
static const _CONSOLE_API_SUPPORT_HEADER =
'with ((this && this.console && this.console._commandLineAPI) || {}) {\n';
+ static bool expectsConsoleApi(String expression) {
+ return expression.indexOf(_CONSOLE_API_SUPPORT_HEADER) == 0;;
+ }
+
/**
* Takes an [expression] and a list of [local] variable and returns an
* expression for a closure with a body matching the original expression
@@ -211,7 +215,7 @@ class _Utils {
args[arg] = value;
}
- if (expression.indexOf(_CONSOLE_API_SUPPORT_HEADER) == 0) {
+ if (expectsConsoleApi(expression)) {
expression = expression.substring(expression.indexOf('\n') + 1);
expression = expression.substring(0, expression.lastIndexOf('\n'));
« no previous file with comments | « sdk/lib/js/dartium/js_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698