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

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

Issue 1887233005: Fix all dart:html strong mode errors except for spurious FINAL_NOT_INITIALIZED_CONSTRUCTOR warnings. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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
Index: lib/runtime/dart/html_common.js
diff --git a/lib/runtime/dart/html_common.js b/lib/runtime/dart/html_common.js
index 3fe18bd010d51582839df3caa0c94f69a34ce0ef..9968c81fe108ca0b88a6fe4e869e0fd921fac1bd 100644
--- a/lib/runtime/dart/html_common.js
+++ b/lib/runtime/dart/html_common.js
@@ -7,11 +7,9 @@ dart_library.library('dart/html_common', null, /* Imports */[
'dart/_js_helper',
'dart/_native_typed_data',
'dart/async',
- 'dart/_internal',
'dart/collection'
], /* Lazy imports */[
- 'dart/web_gl'
-], function(exports, dart, _metadata, core, html, typed_data, _js_helper, _native_typed_data, async, _internal, collection, web_gl) {
+], function(exports, dart, _metadata, core, html, typed_data, _js_helper, _native_typed_data, async, collection) {
'use strict';
let dartx = dart.dartx;
dart.export(exports, _metadata);
@@ -109,7 +107,7 @@ dart_library.library('dart/html_common', null, /* Imports */[
this.modify(dart.fn(s => s.addAll(iterable[dartx.map](dart.bind(this, _validateToken))), dart.void, [core.Set$(core.String)]));
}
removeAll(iterable) {
- this.modify(dart.fn(s => s.removeAll(iterable[dartx.map](dart.as(dart.bind(this, _validateToken), dart.functionType(core.String, [core.Object])))), dart.void, [core.Set$(core.String)]));
+ this.modify(dart.fn(s => s.removeAll(iterable), dart.void, [core.Set$(core.String)]));
}
toggleAll(iterable, shouldAdd) {
if (shouldAdd === void 0) shouldAdd = null;
@@ -215,7 +213,7 @@ dart_library.library('dart/html_common', null, /* Imports */[
containsAll: [core.bool, [core.Iterable$(core.Object)]],
intersection: [core.Set$(core.String), [core.Set$(core.Object)]],
union: [core.Set$(core.String), [core.Set$(core.String)]],
- difference: [core.Set$(core.String), [core.Set$(core.String)]],
+ difference: [core.Set$(core.String), [core.Set$(core.Object)]],
toList: [core.List$(core.String), [], {growable: core.bool}],
toSet: [core.Set$(core.String), []],
take: [core.Iterable$(core.String), [core.int]],
@@ -430,8 +428,8 @@ dart_library.library('dart/html_common', null, /* Imports */[
convertNativeToDart_AcceptStructuredClone: [dart.dynamic, [dart.dynamic], {mustCopy: dart.dynamic}]
})
});
- class _TypedContextAttributes extends core.Object {
- _TypedContextAttributes(alpha, antialias, depth, failIfMajorPerformanceCaveat, premultipliedAlpha, preserveDrawingBuffer, stencil) {
+ class ContextAttributes extends core.Object {
+ ContextAttributes(alpha, antialias, depth, failIfMajorPerformanceCaveat, premultipliedAlpha, preserveDrawingBuffer, stencil) {
this.alpha = alpha;
this.antialias = antialias;
this.depth = depth;
@@ -441,33 +439,13 @@ dart_library.library('dart/html_common', null, /* Imports */[
this.stencil = stencil;
}
}
- _TypedContextAttributes[dart.implements] = () => [web_gl.ContextAttributes];
- dart.setSignature(_TypedContextAttributes, {
- constructors: () => ({_TypedContextAttributes: [_TypedContextAttributes, [core.bool, core.bool, core.bool, core.bool, core.bool, core.bool, core.bool]]})
+ dart.setSignature(ContextAttributes, {
+ constructors: () => ({ContextAttributes: [ContextAttributes, [core.bool, core.bool, core.bool, core.bool, core.bool, core.bool, core.bool]]})
});
- dart.defineExtensionMembers(_TypedContextAttributes, [
- 'alpha',
- 'alpha',
- 'antialias',
- 'antialias',
- 'depth',
- 'depth',
- 'premultipliedAlpha',
- 'premultipliedAlpha',
- 'preserveDrawingBuffer',
- 'preserveDrawingBuffer',
- 'stencil',
- 'stencil',
- 'failIfMajorPerformanceCaveat',
- 'failIfMajorPerformanceCaveat'
- ]);
function convertNativeToDart_ContextAttributes(nativeContextAttributes) {
- if (dart.is(nativeContextAttributes, web_gl.ContextAttributes)) {
- return nativeContextAttributes;
- }
- return new _TypedContextAttributes(dart.as(nativeContextAttributes.alpha, core.bool), dart.as(nativeContextAttributes.antialias, core.bool), dart.as(nativeContextAttributes.depth, core.bool), dart.as(nativeContextAttributes.failIfMajorPerformanceCaveat, core.bool), dart.as(nativeContextAttributes.premultipliedAlpha, core.bool), dart.as(nativeContextAttributes.preserveDrawingBuffer, core.bool), dart.as(nativeContextAttributes.stencil, core.bool));
+ return new ContextAttributes(dart.as(nativeContextAttributes.alpha, core.bool), dart.as(nativeContextAttributes.antialias, core.bool), dart.as(nativeContextAttributes.depth, core.bool), dart.as(nativeContextAttributes.failIfMajorPerformanceCaveat, core.bool), dart.as(nativeContextAttributes.premultipliedAlpha, core.bool), dart.as(nativeContextAttributes.preserveDrawingBuffer, core.bool), dart.as(nativeContextAttributes.stencil, core.bool));
}
- dart.fn(convertNativeToDart_ContextAttributes, () => dart.definiteFunctionType(web_gl.ContextAttributes, [dart.dynamic]));
+ dart.fn(convertNativeToDart_ContextAttributes);
class _TypedImageData extends core.Object {
_TypedImageData(data, height, width) {
this.data = data;
@@ -635,14 +613,6 @@ dart_library.library('dart/html_common', null, /* Imports */[
return completer.future;
}
dart.fn(convertNativePromiseToDartFuture, async.Future, [dart.dynamic]);
- function wrap_jso(jsObject) {
- return jsObject;
- }
- dart.fn(wrap_jso);
- function unwrap_jso(dartClass_instance) {
- return dartClass_instance;
- }
- dart.fn(unwrap_jso);
class Device extends core.Object {
static get userAgent() {
return html.window[dartx.navigator][dartx.userAgent];
@@ -729,7 +699,7 @@ dart_library.library('dart/html_common', null, /* Imports */[
this[_node] = node;
}
get [_iterable]() {
- return new (_internal.WhereIterable$(html.Element))(this[_childNodes], dart.fn(n => dart.is(n, html.Element), core.bool, [html.Element]));
+ return this[_childNodes][dartx.where](dart.fn(n => dart.is(n, html.Element), core.bool, [html.Node]))[dartx.map](dart.fn(n => dart.as(n, html.Element), html.Element, [html.Node]));
}
get [_filtered]() {
return core.List$(html.Element).from(this[_iterable], {growable: false});
@@ -931,6 +901,7 @@ dart_library.library('dart/html_common', null, /* Imports */[
exports.CssClassSetImpl = CssClassSetImpl;
exports.convertDartToNative_SerializedScriptValue = convertDartToNative_SerializedScriptValue;
exports.convertNativeToDart_SerializedScriptValue = convertNativeToDart_SerializedScriptValue;
+ exports.ContextAttributes = ContextAttributes;
exports.convertNativeToDart_ContextAttributes = convertNativeToDart_ContextAttributes;
exports.convertNativeToDart_ImageData = convertNativeToDart_ImageData;
exports.convertDartToNative_ImageData = convertDartToNative_ImageData;
@@ -950,8 +921,6 @@ dart_library.library('dart/html_common', null, /* Imports */[
exports.isImmutableJavaScriptArray = isImmutableJavaScriptArray;
exports.isJavaScriptPromise = isJavaScriptPromise;
exports.convertNativePromiseToDartFuture = convertNativePromiseToDartFuture;
- exports.wrap_jso = wrap_jso;
- exports.unwrap_jso = unwrap_jso;
exports.Device = Device;
exports.FilteredElementList = FilteredElementList;
exports.Lists = Lists;

Powered by Google App Engine
This is Rietveld 408576698