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

Unified Diff: sdk/lib/html/dartium/html_dartium.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:
Download patch
« no previous file with comments | « no previous file | tools/dom/src/html_native_DOMImplementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 8722ec60efd69d905243671e1868aa79abc769dc..9cf3a84c5e2488320a9f560bc4bc0aa7659d8c3c 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -37533,12 +37533,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;
}
/**
@@ -37553,7 +37563,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 | « no previous file | tools/dom/src/html_native_DOMImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698