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

Unified Diff: lib/runtime/dart/_js_helper.js

Issue 1641643004: Roll analyzer to 0.27.2-alpha.1 (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rerun tests and format Created 4 years, 11 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 | « lib/runtime/dart/_isolate_helper.js ('k') | lib/runtime/dart/async.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/_js_helper.js
diff --git a/lib/runtime/dart/_js_helper.js b/lib/runtime/dart/_js_helper.js
index 67f941c56ab60de0ca3d3dd24b770103cb719c5d..a046e15957c504d75e36cf1d3495558315d4679d 100644
--- a/lib/runtime/dart/_js_helper.js
+++ b/lib/runtime/dart/_js_helper.js
@@ -352,7 +352,7 @@ dart_library.library('dart/_js_helper', null, /* Imports */[
if (typeof other == 'string') {
return !dart.equals(dart.dsend(receiver, 'indexOf', other, startIndex), -1);
} else if (dart.is(other, JSSyntaxRegExp)) {
- return dart.dsend(other, 'hasMatch', dart.dsend(receiver, 'substring', startIndex));
+ return other.hasMatch(dart.as(dart.dsend(receiver, 'substring', startIndex), core.String));
} else {
let substr = dart.dsend(receiver, 'substring', startIndex);
return dart.dload(dart.dsend(other, 'allMatches', substr), 'isNotEmpty');
@@ -376,7 +376,7 @@ dart_library.library('dart/_js_helper', null, /* Imports */[
function stringReplaceAllUnchecked(receiver, from, to) {
checkString(to);
if (typeof from == 'string') {
- if (dart.equals(from, "")) {
+ if (from == "") {
if (dart.equals(receiver, "")) {
return to;
} else {
@@ -396,7 +396,7 @@ dart_library.library('dart/_js_helper', null, /* Imports */[
return stringReplaceJS(receiver, replacer, to);
}
} else if (dart.is(from, JSSyntaxRegExp)) {
- let re = regExpGetGlobalNative(dart.as(from, JSSyntaxRegExp));
+ let re = regExpGetGlobalNative(from);
return stringReplaceJS(receiver, re, to);
} else {
checkNull(from);
@@ -482,9 +482,9 @@ dart_library.library('dart/_js_helper', null, /* Imports */[
if (typeof from == 'string') {
let index = dart.dsend(receiver, 'indexOf', from, startIndex);
if (dart.notNull(dart.as(dart.dsend(index, '<', 0), core.bool))) return receiver;
- return `${dart.dsend(receiver, 'substring', 0, index)}${to}` + `${dart.dsend(receiver, 'substring', dart.dsend(index, '+', dart.dload(from, 'length')))}`;
+ return `${dart.dsend(receiver, 'substring', 0, index)}${to}` + `${dart.dsend(receiver, 'substring', dart.dsend(index, '+', from[dartx.length]))}`;
} else if (dart.is(from, JSSyntaxRegExp)) {
- return startIndex == 0 ? stringReplaceJS(receiver, regExpGetNative(dart.as(from, JSSyntaxRegExp)), to) : stringReplaceFirstRE(receiver, from, to, startIndex);
+ return startIndex == 0 ? stringReplaceJS(receiver, regExpGetNative(from), to) : stringReplaceFirstRE(receiver, from, to, startIndex);
} else {
checkNull(from);
dart.throw("String.replace(Pattern) UNIMPLEMENTED");
« no previous file with comments | « lib/runtime/dart/_isolate_helper.js ('k') | lib/runtime/dart/async.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698