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')); |