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

Unified Diff: pkg/dev_compiler/lib/js/amd/dart_sdk.js

Side-by-side diff isn't available for this file because of its large size.
Issue 2739863003: Add option to suppress type-check whitelisting (Closed)
Patch Set: Created 3 years, 9 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 | pkg/dev_compiler/lib/js/common/dart_sdk.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/js/amd/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/amd/dart_sdk.js b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
index aeb579b9325425b8819c22c826fcb55979f30746..24f2ded76df89c819f62329a6eb5c1a056859802 100644
--- a/pkg/dev_compiler/lib/js/amd/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
@@ -709,6 +709,7 @@ define([], function() {
let dynamicAndStringAnddynamicTovoid = () => (dynamicAndStringAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic, core.String, dart.dynamic])))();
let FAndintToF = () => (FAndintToF = dart.constFn(dart.definiteFunctionType(F => [F, [F, core.int]])))();
let JSSyntaxRegExpTodynamic = () => (JSSyntaxRegExpTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [_js_helper.JSSyntaxRegExp])))();
+ let ListToListOfString = () => (ListToListOfString = dart.constFn(dart.definiteFunctionType(ListOfString(), [core.List])))();
let JSSyntaxRegExpToint = () => (JSSyntaxRegExpToint = dart.constFn(dart.definiteFunctionType(core.int, [_js_helper.JSSyntaxRegExp])))();
let JSSyntaxRegExpAndStringAndintToMatch = () => (JSSyntaxRegExpAndStringAndintToMatch = dart.constFn(dart.definiteFunctionType(core.Match, [_js_helper.JSSyntaxRegExp, core.String, core.int])))();
let dynamicAnddynamicAnddynamicToint = () => (dynamicAnddynamicAnddynamicToint = dart.constFn(dart.definiteFunctionType(core.int, [dart.dynamic, dart.dynamic, dart.dynamic])))();
@@ -1886,6 +1887,9 @@ define([], function() {
dart.trapRuntimeErrors = function(flag) {
dart._trapRuntimeErrors = flag;
};
+ dart.ignoreWhitelistedErrors = function(flag) {
+ dart._ignoreWhitelistedErrors = flag;
+ };
dart.throwCastError = function(object, actual, type) {
var found = dart.typeName(actual);
var expected = dart.typeName(type);
@@ -2249,7 +2253,7 @@ define([], function() {
let result = dart.isSubtype(actual, type);
if (result || actual == dart.jsobject || actual == core.int && type == core.double) return true;
if (result === false) return false;
- if (ignoreFromWhiteList == void 0) return result;
+ if (!dart._ignoreWhitelistedErrors || ignoreFromWhiteList == void 0) return result;
if (dart._ignoreTypeFailure(actual, type)) return true;
return result;
};
@@ -2993,6 +2997,7 @@ define([], function() {
dart._typeFormalCount = Symbol("_typeFormalCount");
dart.isSubtype = dart._subtypeMemo((t1, t2) => t1 === t2 || dart._isSubtype(t1, t2, true));
dart._trapRuntimeErrors = true;
+ dart._ignoreWhitelistedErrors = true;
dart._jsIterator = Symbol("_jsIterator");
dart._current = Symbol("_current");
dart._AsyncStarStreamController = class _AsyncStarStreamController {
@@ -12833,6 +12838,10 @@ define([], function() {
return regexp[_nativeRegExp];
};
dart.lazyFn(_js_helper.regExpGetNative, () => JSSyntaxRegExpTodynamic());
+ _js_helper._stringList = function(l) {
+ return ListOfString()._check(l == null ? l : dart.list(l, core.String));
+ };
+ dart.lazyFn(_js_helper._stringList, () => ListToListOfString());
const _nativeGlobalVersion = Symbol('_nativeGlobalVersion');
_js_helper.regExpGetGlobalNative = function(regexp) {
let nativeRegexp = regexp[_nativeGlobalVersion];
@@ -12899,7 +12908,7 @@ define([], function() {
firstMatch(string) {
let m = this[_nativeRegExp].exec(_js_helper.checkString(string));
if (m == null) return null;
- return new _js_helper._MatchImplementation(this, m);
+ return new _js_helper._MatchImplementation(this, _js_helper._stringList(m));
}
hasMatch(string) {
return this[_nativeRegExp].test(_js_helper.checkString(string));
@@ -12923,7 +12932,7 @@ define([], function() {
regexp.lastIndex = start;
let match = regexp.exec(string);
if (match == null) return null;
- return new _js_helper._MatchImplementation(this, ListOfString()._check(match));
+ return new _js_helper._MatchImplementation(this, _js_helper._stringList(match));
}
[_execAnchored](string, start) {
let regexp = this[_nativeAnchoredVersion];
@@ -12932,7 +12941,7 @@ define([], function() {
if (match == null) return null;
if (match[dartx._get](dart.notNull(match[dartx.length]) - 1) != null) return null;
match[dartx.length] = dart.notNull(match[dartx.length]) - 1;
- return new _js_helper._MatchImplementation(this, ListOfString()._check(match));
+ return new _js_helper._MatchImplementation(this, _js_helper._stringList(match));
}
matchAsPrefix(string, start) {
if (start === void 0) start = 0;
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/js/common/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698