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

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

Issue 284113004: Check for Dartium 35 string indicating that an eval call occurs on the console. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: ptal Created 6 years, 7 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/html/dartium/html_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/html_native_DOMImplementation.dart
diff --git a/tools/dom/src/html_native_DOMImplementation.dart b/tools/dom/src/html_native_DOMImplementation.dart
index af2983c115929810f01e9aa9d31252ef0b32ce9e..304c474da091448e5f1f4149cda8233e92b3e1d1 100644
--- a/tools/dom/src/html_native_DOMImplementation.dart
+++ b/tools/dom/src/html_native_DOMImplementation.dart
@@ -146,12 +146,22 @@ class _Utils {
/**
* Header passed in from the Dartium Developer Tools when an expression is
* evaluated in the console as opposed to the watch window or another context
- * that does not expect REPL support.
+ * that does not expect REPL support in Dartium 34.
*/
- static const _CONSOLE_API_SUPPORT_HEADER =
+ static const _CONSOLE_API_SUPPORT_HEADER_34 =
'with ((console && console._commandLineAPI) || { __proto__: null }) {\n';
+ /**
+ * Header passed in from the Dartium Developer Tools when an expression is
+ * evaluated in the console as opposed to the watch window or another context
+ * that does not expect REPL support in Dartium 35.
+ */
+ static const _CONSOLE_API_SUPPORT_HEADER_35 =
+ 'with (__commandLineAPI || { __proto__: null }) {\n';
+
+
static bool expectsConsoleApi(String expression) {
- return expression.indexOf(_CONSOLE_API_SUPPORT_HEADER) == 0;;
+ return expression.indexOf(_CONSOLE_API_SUPPORT_HEADER_34) == 0 ||
+ expression.indexOf(_CONSOLE_API_SUPPORT_HEADER_35) == 0;
}
/**
@@ -166,7 +176,7 @@ class _Utils {
* For example:
* <code>
* _consoleTempVariables = {'a' : someValue, 'b': someOtherValue}
- * wrapExpressionAsClosure("${_CONSOLE_API_SUPPORT_HEADER}foo + bar + a",
+ * wrapExpressionAsClosure("${_CONSOLE_API_SUPPORT_HEADER35}foo + bar + a",
* ["bar", 40, "foo", 2])
* </code>
* will return:
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698