Fixed analyzer test to use dart2js not dartium

R=paulberry@google.com

Committed: 704de3bb3e
Review-Url: https://codereview.chromium.org/3004153002 .
This commit is contained in:
Terry Lucas 2017-09-01 09:03:10 -07:00
parent 002917b79c
commit 0585e74b63
26 changed files with 50 additions and 120741 deletions

View file

@ -52,9 +52,6 @@ class SummaryBuilder {
//
Set<String> uriSet =
sdk.sdkLibraries.map((SdkLibrary library) => library.shortName).toSet();
if (!strong) {
uriSet.add('dart:html/nativewrappers.dart');
}
uriSet.add('dart:html_common/html_common_dart2js.dart');
Set<Source> librarySources = new HashSet<Source>();

View file

@ -223,8 +223,8 @@ class DirectoryBasedDartSdkTest {
void test_fromFile_library_firstExact() {
DirectoryBasedDartSdk sdk = _createDartSdk();
JavaFile dirHtml = new JavaFile.relative(sdk.libraryDirectory, "html");
JavaFile dirDartium = new JavaFile.relative(dirHtml, "dartium");
JavaFile file = new JavaFile.relative(dirDartium, "html_dartium.dart");
JavaFile dirDart2js = new JavaFile.relative(dirHtml, "dart2js");
JavaFile file = new JavaFile.relative(dirDart2js, "html_dart2js.dart");
expect(file.isFile(), isTrue);
Source source = sdk.fromFileUri(file.toURI());
expect(source, isNotNull);

View file

@ -61,20 +61,20 @@ const Map<String, LibraryInfo> libraries = const {
categories: "Client,Server,Embedded",
maturity: Maturity.UNSTABLE,
dart2jsPatchPath: "_internal/js_runtime/lib/developer_patch.dart"),
"html": const LibraryInfo("html/dartium/html_dartium.dart",
"html": const LibraryInfo("html/dart2js/html_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "html/dart2js/html_dart2js.dart"),
platforms: DART2JS_PLATFORM),
"html_common": const LibraryInfo("html/html_common/html_common.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "html/html_common/html_common_dart2js.dart",
documented: false,
implementation: true),
"indexed_db": const LibraryInfo("indexed_db/dartium/indexed_db_dartium.dart",
"indexed_db": const LibraryInfo("indexed_db/dart2js/indexed_db_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "indexed_db/dart2js/indexed_db_dart2js.dart"),
platforms: DART2JS_PLATFORM),
"io": const LibraryInfo("io/io.dart",
categories: "Server",
dart2jsPatchPath: "_internal/js_runtime/lib/io_patch.dart"),
@ -82,14 +82,14 @@ const Map<String, LibraryInfo> libraries = const {
categories: "Client,Server",
maturity: Maturity.STABLE,
dart2jsPatchPath: "_internal/js_runtime/lib/isolate_patch.dart"),
"js": const LibraryInfo("js/dartium/js_dartium.dart",
"js": const LibraryInfo("js/dart2js/js_dart2js.dart",
categories: "Client",
maturity: Maturity.STABLE,
dart2jsPath: "js/dart2js/js_dart2js.dart"),
"js_util": const LibraryInfo("js_util/dartium/js_util_dartium.dart",
platforms: DART2JS_PLATFORM),
"js_util": const LibraryInfo("js_util/dart2js/js_util_dart2js.dart",
categories: "Client",
maturity: Maturity.STABLE,
dart2jsPath: "js_util/dart2js/js_util_dart2js.dart"),
platforms: DART2JS_PLATFORM),
"math": const LibraryInfo("math/math.dart",
categories: "Client,Server,Embedded",
maturity: Maturity.STABLE,
@ -102,7 +102,7 @@ const Map<String, LibraryInfo> libraries = const {
categories: "Client",
implementation: true,
documented: false,
dart2jsPath: "html/dart2js/nativewrappers.dart"),
platforms: DART2JS_PLATFORM),
"typed_data": const LibraryInfo("typed_data/typed_data.dart",
categories: "Client,Server,Embedded",
maturity: Maturity.STABLE,
@ -113,22 +113,22 @@ const Map<String, LibraryInfo> libraries = const {
implementation: true,
documented: false,
platforms: DART2JS_PLATFORM),
"svg": const LibraryInfo("svg/dartium/svg_dartium.dart",
"svg": const LibraryInfo("svg/dart2js/svg_dart2js.dart.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "svg/dart2js/svg_dart2js.dart"),
"web_audio": const LibraryInfo("web_audio/dartium/web_audio_dartium.dart",
platforms: DART2JS_PLATFORM),
"web_audio": const LibraryInfo("web_audio/dart2js/web_audio_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "web_audio/dart2js/web_audio_dart2js.dart"),
"web_gl": const LibraryInfo("web_gl/dartium/web_gl_dartium.dart",
platforms: DART2JS_PLATFORM),
"web_gl": const LibraryInfo("web_gl/dart2js/web_gl_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "web_gl/dart2js/web_gl_dart2js.dart"),
"web_sql": const LibraryInfo("web_sql/dartium/web_sql_dartium.dart",
platforms: DART2JS_PLATFORM),
"web_sql": const LibraryInfo("web_sql/dart2js/web_sql_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "web_sql/dart2js/web_sql_dart2js.dart"),
platforms: DART2JS_PLATFORM),
"_internal": const LibraryInfo("internal/internal.dart",
categories: "",
documented: false,

View file

@ -108,7 +108,7 @@ gen_library_src_path("generate_html_cc_file") {
name = "html"
kind = "source"
sources = [
"../../sdk/lib/html/dartium/html_dartium.dart",
"../../sdk/lib/html/dart2js/html_dart2js.dart",
]
output = "$target_gen_dir/html_gen.cc"
}
@ -118,7 +118,7 @@ gen_library_src_path("generate_html_common_cc_file") {
kind = "source"
sources = [
"../../sdk/lib/html/html_common/conversions.dart",
"../../sdk/lib/html/html_common/conversions_dartium.dart",
"../../sdk/lib/html/html_common/conversions_dart2js.dart",
"../../sdk/lib/html/html_common/css_class_set.dart",
"../../sdk/lib/html/html_common/device.dart",
"../../sdk/lib/html/html_common/filtered_element_list.dart",
@ -132,7 +132,7 @@ gen_library_src_path("generate_js_cc_file") {
name = "js"
kind = "source"
sources = [
"../../sdk/lib/js/dartium/js_dartium.dart",
"../../sdk/lib/js/dart2js/js_dart2js.dart",
]
output = "$target_gen_dir/js_gen.cc"
}
@ -141,44 +141,25 @@ gen_library_src_path("generate_js_util_cc_file") {
name = "js_util"
kind = "source"
sources = [
"../../sdk/lib/js_util/dartium/js_util_dartium.dart",
"../../sdk/lib/js_util/dart2js/js_util_dart2js.dart",
]
output = "$target_gen_dir/js_util_gen.cc"
}
gen_library_src_path("generate_blink_cc_file") {
name = "_blink"
kind = "source"
sources = [
"../../sdk/lib/_blink/dartium/_blink_dartium.dart",
]
output = "$target_gen_dir/blink_gen.cc"
}
gen_library_src_path("generate_indexed_db_cc_file") {
name = "indexed_db"
kind = "source"
sources = [
"../../sdk/lib/indexed_db/dartium/indexed_db_dartium.dart",
"../../sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart",
]
output = "$target_gen_dir/indexed_db_gen.cc"
}
gen_library_src_path("generate_cached_patches_cc_file") {
name = "cached_patches"
library_name = "cached_patches.dart"
kind = "source"
sources = [
"../../sdk/lib/js/dartium/cached_patches.dart",
]
output = "$target_gen_dir/cached_patches_gen.cc"
}
gen_library_src_path("generate_web_gl_cc_file") {
name = "web_gl"
kind = "source"
sources = [
"../../sdk/lib/web_gl/dartium/web_gl_dartium.dart",
"../../sdk/lib/web_gl/dart2js/web_gl_dart2js.dart",
]
output = "$target_gen_dir/web_gl_gen.cc"
}
@ -197,7 +178,7 @@ gen_library_src_path("generate_web_sql_cc_file") {
name = "web_sql"
kind = "source"
sources = [
"../../sdk/lib/web_sql/dartium/web_sql_dartium.dart",
"../../sdk/lib/web_sql/dart2js/web_sql_dart2js.dart",
]
output = "$target_gen_dir/web_sql_gen.cc"
}
@ -206,7 +187,7 @@ gen_library_src_path("generate_svg_cc_file") {
name = "svg"
kind = "source"
sources = [
"../../sdk/lib/svg/dartium/svg_dartium.dart",
"../../sdk/lib/svg/dart2js/svg_dart2js.dart",
]
output = "$target_gen_dir/svg_gen.cc"
}
@ -215,7 +196,7 @@ gen_library_src_path("generate_web_audio_cc_file") {
name = "web_audio"
kind = "source"
sources = [
"../../sdk/lib/web_audio/dartium/web_audio_dartium.dart",
"../../sdk/lib/web_audio/dart2js/web_audio_dart2js.dart",
]
output = "$target_gen_dir/web_audio_gen.cc"
}
@ -244,9 +225,7 @@ template("build_libdart_builtin") {
}
public_configs = [ ":libdart_builtin_config" ]
deps = [
":generate_blink_cc_file",
":generate_builtin_cc_file",
":generate_cached_patches_cc_file",
":generate_html_cc_file",
":generate_html_common_cc_file",
":generate_indexed_db_cc_file",
@ -800,9 +779,7 @@ dart_executable("dart_bootstrap") {
]
extra_deps = [
":gen_resources_cc",
":generate_blink_cc_file",
":generate_builtin_cc_file",
":generate_cached_patches_cc_file",
":generate_html_cc_file",
":generate_html_common_cc_file",
":generate_indexed_db_cc_file",
@ -831,9 +808,7 @@ dart_executable("dart_bootstrap") {
"snapshot_empty.cc",
# Include generated source files.
"$target_gen_dir/blink_gen.cc",
"$target_gen_dir/builtin_gen.cc",
"$target_gen_dir/cached_patches_gen.cc",
"$target_gen_dir/html_common_gen.cc",
"$target_gen_dir/html_gen.cc",
"$target_gen_dir/indexed_db_gen.cc",

View file

@ -25,9 +25,7 @@ Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
{"dart:html_common", html_common_source_paths_, NULL, NULL, true},
{"dart:js", js_source_paths_, NULL, NULL, true},
{"dart:js_util", js_util_source_paths_, NULL, NULL, true},
{"dart:_blink", _blink_source_paths_, NULL, NULL, true},
{"dart:indexed_db", indexed_db_source_paths_, NULL, NULL, true},
{"cached_patches.dart", cached_patches_source_paths_, NULL, NULL, true},
{"dart:web_gl", web_gl_source_paths_, NULL, NULL, true},
{"metadata.dart", metadata_source_paths_, NULL, NULL, true},
{"dart:web_sql", web_sql_source_paths_, NULL, NULL, true},

View file

@ -73,9 +73,7 @@ class Builtin {
static const char* html_common_source_paths_[];
static const char* js_source_paths_[];
static const char* js_util_source_paths_[];
static const char* _blink_source_paths_[];
static const char* indexed_db_source_paths_[];
static const char* cached_patches_source_paths_[];
static const char* web_gl_source_paths_[];
static const char* metadata_source_paths_[];
static const char* web_sql_source_paths_[];

View file

@ -349,7 +349,7 @@ static RawInstance* CreateLibraryMirror(Thread* thread, const Library& lib) {
args.SetAt(1, str);
str = lib.url();
const char* censored_libraries[] = {
"dart:_builtin", "dart:_blink", "dart:_vmservice", NULL,
"dart:_builtin", "dart:_vmservice", NULL,
};
for (intptr_t i = 0; censored_libraries[i] != NULL; i++) {
if (str.Equals(censored_libraries[i])) {

View file

@ -177,7 +177,6 @@ _platform_sdk_libraries = [
]
_full_sdk_libraries = [
"_blink",
"_chrome",
"_internal",
"async",

File diff suppressed because it is too large Load diff

View file

@ -1,15 +0,0 @@
/// Native wrappers for the Chrome Packaged App APIs.
///
/// These functions allow direct access to the Packaged App APIs, allowing
/// Chrome Packaged Apps to be written using Dart.
///
/// For more information on these APIs, see the
/// [Chrome APIs Documentation](http://developer.chrome.com/extensions/api_index.html)
library _chrome;
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// DO NOT EDIT
// Auto-generated dart:_chrome library.

View file

@ -45,11 +45,6 @@ const Map<String, LibraryInfo> libraries = const {
categories: "Client,Server",
maturity: Maturity.STABLE,
dart2jsPatchPath: "_internal/js_runtime/lib/async_patch.dart"),
"_blink": const LibraryInfo("_blink/dartium/_blink_dartium.dart",
categories: "Client",
implementation: true,
documented: false,
platforms: VM_PLATFORM),
"_chrome": const LibraryInfo("_chrome/dart2js/chrome_dart2js.dart",
categories: "Client", documented: false),
"collection": const LibraryInfo("collection/collection.dart",
@ -68,20 +63,20 @@ const Map<String, LibraryInfo> libraries = const {
categories: "Client,Server,Embedded",
maturity: Maturity.UNSTABLE,
dart2jsPatchPath: "_internal/js_runtime/lib/developer_patch.dart"),
"html": const LibraryInfo("html/dartium/html_dartium.dart",
"html": const LibraryInfo("html/dart2js/html_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "html/dart2js/html_dart2js.dart"),
platforms: DART2JS_PLATFORM),
"html_common": const LibraryInfo("html/html_common/html_common.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "html/html_common/html_common_dart2js.dart",
documented: false,
implementation: true),
"indexed_db": const LibraryInfo("indexed_db/dartium/indexed_db_dartium.dart",
"indexed_db": const LibraryInfo("indexed_db/dart2js/indexed_db_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "indexed_db/dart2js/indexed_db_dart2js.dart"),
platforms: DART2JS_PLATFORM),
"io": const LibraryInfo("io/io.dart",
categories: "Server",
dart2jsPatchPath: "_internal/js_runtime/lib/io_patch.dart"),
@ -89,14 +84,14 @@ const Map<String, LibraryInfo> libraries = const {
categories: "Client,Server",
maturity: Maturity.STABLE,
dart2jsPatchPath: "_internal/js_runtime/lib/isolate_patch.dart"),
"js": const LibraryInfo("js/dartium/js_dartium.dart",
"js": const LibraryInfo("js/dart2js/js_dart2js.dart",
categories: "Client",
maturity: Maturity.STABLE,
dart2jsPath: "js/dart2js/js_dart2js.dart"),
"js_util": const LibraryInfo("js_util/dartium/js_util_dartium.dart",
platforms: DART2JS_PLATFORM),
"js_util": const LibraryInfo("js_util/dart2js/js_util_dart2js.dart",
categories: "Client",
maturity: Maturity.STABLE,
dart2jsPath: "js_util/dart2js/js_util_dart2js.dart"),
platforms: DART2JS_PLATFORM),
"math": const LibraryInfo("math/math.dart",
categories: "Client,Server,Embedded",
maturity: Maturity.STABLE,
@ -120,22 +115,22 @@ const Map<String, LibraryInfo> libraries = const {
implementation: true,
documented: false,
platforms: DART2JS_PLATFORM),
"svg": const LibraryInfo("svg/dartium/svg_dartium.dart",
"svg": const LibraryInfo("svg/dart2js/svg_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "svg/dart2js/svg_dart2js.dart"),
"web_audio": const LibraryInfo("web_audio/dartium/web_audio_dartium.dart",
platforms: DART2JS_PLATFORM),
"web_audio": const LibraryInfo("web_audio/dart2js/web_audio_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "web_audio/dart2js/web_audio_dart2js.dart"),
"web_gl": const LibraryInfo("web_gl/dartium/web_gl_dartium.dart",
platforms: DART2JS_PLATFORM),
"web_gl": const LibraryInfo("web_gl/dart2js/web_gl_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "web_gl/dart2js/web_gl_dart2js.dart"),
"web_sql": const LibraryInfo("web_sql/dartium/web_sql_dartium.dart",
platforms: DART2JS_PLATFORM),
"web_sql": const LibraryInfo("web_sql/dart2js/web_sql_dart2js.dart",
categories: "Client",
maturity: Maturity.WEB_STABLE,
dart2jsPath: "web_sql/dart2js/web_sql_dart2js.dart"),
platforms: DART2JS_PLATFORM),
"_internal": const LibraryInfo("internal/internal.dart",
categories: "",
documented: false,

File diff suppressed because it is too large Load diff

View file

@ -1,294 +0,0 @@
part of html_common;
convertDartToNative_PrepareForStructuredClone(value) =>
new _StructuredCloneDartium()
.convertDartToNative_PrepareForStructuredClone(value);
convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) =>
new _AcceptStructuredCloneDartium()
.convertNativeToDart_AcceptStructuredClone(object, mustCopy: mustCopy);
class _StructuredCloneDartium extends _StructuredClone {
newJsMap() => js.JsNative.newObject();
putIntoMap(map, key, value) => js.JsNative.setProperty(map, key, value);
newJsList(length) => js.JsNative.newArray()..length = length;
cloneNotRequired(e) => e is js.JSObject || e is TypedData || e is ByteBuffer;
}
/// A version of _AcceptStructuredClone, but using a different algorithm
/// so we can take advantage of an identity HashMap on Dartium without
/// the bad side-effect of modifying the JS source objects if we do the same in
/// dart2js.
///
/// This no longer inherits anything from _AcceptStructuredClone
/// and is never used polymorphically with it, so it doesn't inherit.
class _AcceptStructuredCloneDartium {
newDartList(length) => new List(length);
// As long as we stick to JSObject instead of intermingling legacy JsObject,
// we can simply use identical.
bool identicalInJs(a, b) => identical(a, b);
void forEachJsField(jsObject, action) {
var keys = js.JsNative.callMethod(_object, "keys", [jsObject]);
for (var key in keys) {
action(key, js.JsNative.getProperty(jsObject, key));
}
}
// Keep track of the clones, keyed by the original object. If we're
// not copying, these may be the same.
var clones = new HashMap.identity();
bool mustCopy = false;
Object findSlot(value) {
return clones.putIfAbsent(value, () => null);
}
writeSlot(original, x) {
clones[original] = x;
}
walk(e) {
if (e == null) return e;
if (e is bool) return e;
if (e is num) return e;
if (e is String) return e;
if (e is DateTime) return e;
if (isJavaScriptRegExp(e)) {
// TODO(sra).
throw new UnimplementedError('structured clone of RegExp');
}
if (isJavaScriptPromise(e)) {
return convertNativePromiseToDartFuture(e);
}
if (isJavaScriptSimpleObject(e)) {
// TODO(sra): If mustCopy is false, swizzle the prototype for one of a Map
// implementation that uses the properies as storage.
var copy = findSlot(e);
if (copy != null) return copy;
copy = {};
writeSlot(e, copy);
forEachJsField(e, (key, value) => copy[key] = walk(value));
return copy;
}
if (isJavaScriptArray(e)) {
var copy = findSlot(e);
if (copy != null) return copy;
int length = e.length;
// Since a JavaScript Array is an instance of Dart List, we can modify it
// in-place unless we must copy.
copy = mustCopy ? newDartList(length) : e;
writeSlot(e, copy);
for (int i = 0; i < length; i++) {
copy[i] = walk(e[i]);
}
return copy;
}
// Assume anything else is already a valid Dart object, either by having
// already been processed, or e.g. a clonable native class.
return e;
}
convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) {
this.mustCopy = mustCopy;
var copy = walk(object);
return copy;
}
}
final _dateConstructor = js.JsNative.getProperty(window, "Date");
final _regexConstructor = js.JsNative.getProperty(window, "RegExp");
bool isJavaScriptDate(value) =>
value is js.JSObject && js.JsNative.instanceof(value, _dateConstructor);
bool isJavaScriptRegExp(value) =>
value is js.JSObject && js.JsNative.instanceof(value, _regexConstructor);
bool isJavaScriptArray(value) => value is js.JSArray;
final _object = js.JsNative.getProperty(window, "Object");
final _getPrototypeOf = js.JsNative.getProperty(_object, "getPrototypeOf");
_getProto(object) {
return _getPrototypeOf(object);
}
final _objectProto = js.JsNative.getProperty(_object, "prototype");
bool isJavaScriptSimpleObject(value) {
if (value is! js.JSObject) return false;
var proto = _getProto(value);
return proto == _objectProto || proto == null;
}
// TODO(jacobr): this makes little sense unless we are doing something
// ambitious to make Dartium and Dart2Js interop well with each other.
bool isImmutableJavaScriptArray(value) =>
isJavaScriptArray(value) &&
js.JsNative.getProperty(value, "immutable$list") != null;
final _promiseConstructor = js.JsNative.getProperty(window, 'Promise');
bool isJavaScriptPromise(value) =>
value is js.JSObject &&
identical(
js.JsNative.getProperty(value, 'constructor'), _promiseConstructor);
Future convertNativePromiseToDartFuture(js.JSObject promise) {
var completer = new Completer();
var newPromise = js.JsNative.callMethod(
js.JsNative.callMethod(promise, "then",
[js.allowInterop((result) => completer.complete(result))]),
"catch",
[js.allowInterop((result) => completer.completeError(result))]);
return completer.future;
}
convertDartToNative_DateTime(DateTime date) {
return date;
}
/// Creates a Dart Rectangle from a Javascript object with properties
/// left, top, width and height or a 4 element array of integers. Used internally in Dartium.
Rectangle make_dart_rectangle(r) {
if (r == null) return null;
if (r is List) {
return new Rectangle(r[0], r[1], r[2], r[3]);
}
return new Rectangle(
js.JsNative.getProperty(r, 'left'),
js.JsNative.getProperty(r, 'top'),
js.JsNative.getProperty(r, 'width'),
js.JsNative.getProperty(r, 'height'));
}
// Converts a flat Dart map into a JavaScript object with properties this is
// is the Dartium only version it uses dart:js.
// TODO(alanknight): This could probably be unified with the dart2js conversions
// code in html_common and be more general.
convertDartToNative_Dictionary(Map dict) {
if (dict == null) return null;
var jsObject = js.JsNative.newObject();
dict.forEach((String key, value) {
if (value is List) {
var jsArray = js.JsNative.newArray();
value.forEach((elem) {
jsArray.add(elem is Map ? convertDartToNative_Dictionary(elem) : elem);
});
js.JsNative.setProperty(jsObject, key, jsArray);
} else {
js.JsNative.setProperty(jsObject, key, value);
}
});
return jsObject;
}
// Creates a Dart class to allow members of the Map to be fetched (as if getters exist).
// TODO(terry): Need to use package:js but that's a problem in dart:html. Talk to
// Jacob about how to do this properly using dart:js.
class _ReturnedDictionary {
Map _values;
noSuchMethod(Invocation invocation) {
var key = MirrorSystem.getName(invocation.memberName);
if (invocation.isGetter) {
return _values[key];
} else if (invocation.isSetter && key.endsWith('=')) {
key = key.substring(0, key.length - 1);
_values[key] = invocation.positionalArguments[0];
}
}
Map get toMap => _values;
_ReturnedDictionary(Map value) : _values = value != null ? value : {};
}
// Helper function to wrapped a returned dictionary from blink to a Dart looking
// class.
convertNativeDictionaryToDartDictionary(values) {
if (values is! Map) {
// TODO(jacobr): wish wwe didn't have to do this.
values = convertNativeToDart_SerializedScriptValue(values);
}
return values != null ? new _ReturnedDictionary(values) : null;
}
convertNativeToDart_Dictionary(values) =>
convertNativeToDart_SerializedScriptValue(values);
// Conversion function place holder (currently not used in dart2js or dartium).
List convertDartToNative_StringArray(List<String> input) => input;
// Converts a Dart list into a JsArray. For the Dartium version only.
convertDartToNative_List(List input) => new js.JsArray()..addAll(input);
// Incredibly slow implementation to lookup the runtime type for an object.
// Fortunately, performance doesn't matter much as the results are cached
// as long as the object being looked up has a valid prototype.
// TODO(jacobr): we should track the # of lookups to ensure that things aren't
// going off the rails due to objects with null prototypes, etc.
// Note: unlike all other methods in this class, here we intentionally use
// the old JsObject types to bootstrap the new typed bindings.
Type lookupType(js.JsObject jsObject, bool isElement) {
try {
// TODO(jacobr): add static methods that return the runtime type of the patch
// class so that this code works as expected.
if (jsObject is js.JsArray) {
return js.JSArray.instanceRuntimeType;
}
if (jsObject is js.JsFunction) {
return js.JSFunction.instanceRuntimeType;
}
var constructor = js.JsNative.getProperty(jsObject, 'constructor');
if (constructor == null) {
// Perfectly valid case for JavaScript objects where __proto__ has
// intentionally been set to null.
// We should track and warn about this case as peformance will be poor.
return js.JSObject.instanceRuntimeType;
}
var jsTypeName = js.JsNative.getProperty(constructor, 'name');
if (jsTypeName is! String || jsTypeName.length == 0) {
// Not an html type.
return js.JSObject.instanceRuntimeType;
}
var dartClass_instance;
var customElementClass = null;
var extendsTag = "";
Type type = getHtmlCreateType(jsTypeName);
if (type != null) return type;
// Start walking the prototype chain looking for a JS class.
var prototype = js.JsNative.getProperty(jsObject, '__proto__');
while (prototype != null) {
// We're a Dart class that's pointing to a JS class.
var constructor = js.JsNative.getProperty(prototype, 'constructor');
if (constructor != null) {
jsTypeName = js.JsNative.getProperty(constructor, 'name');
type = getHtmlCreateType(jsTypeName);
if (type != null) return type;
}
prototype = js.JsNative.getProperty(prototype, '__proto__');
}
} catch (e) {
// This case can happen for cross frame objects.
if (js.JsNative.hasProperty(e, "postMessage")) {
// assume this is a Window. To match Dart2JS, separate conversion code
// in dart:html will switch the wrapper to a cross frame window as
// required.
// TODO(jacobr): we could consider removing this code completely.
return Window.instanceRuntimeType;
}
}
return js.JSObject.instanceRuntimeType;
}

View file

@ -13,6 +13,8 @@ import 'dart:nativewrappers';
import 'dart:typed_data';
import 'dart:web_gl' as gl;
import 'dart:_js_helper';
import 'metadata.dart';
export 'metadata.dart';
@ -21,4 +23,3 @@ part 'device.dart';
part 'filtered_element_list.dart';
part 'lists.dart';
part 'conversions.dart';
part 'conversions_dartium.dart';

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,40 +0,0 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// Utility methods to efficiently manipulate typed JSInterop objects in cases
/// where the name to call is not known at runtime. You should only use these
/// methods when the same effect cannot be achieved with @JS annotations.
/// These methods would be extension methods on JSObject if Dart supported
/// extension methods.
library dart.js_util;
import 'dart:js';
/// WARNING: performance of this method is much worse than other util
/// methods in this library. Only use this method as a last resort.
///
/// Recursively converts a JSON-like collection of Dart objects to a
/// collection of JavaScript objects and returns a [JsObject] proxy to it.
///
/// [object] must be a [Map] or [Iterable], the contents of which are also
/// converted. Maps and Iterables are copied to a new JavaScript object.
/// Primitives and other transferable values are directly converted to their
/// JavaScript type, and all other objects are proxied.
jsify(object) {
if ((object is! Map) && (object is! Iterable)) {
throw new ArgumentError("object must be a Map or Iterable");
}
return JsNative.jsify(object);
}
JSObject newObject() => JsNative.newObject();
hasProperty(JSObject o, name) => JsNative.hasProperty(o, name);
getProperty(JSObject o, name) => JsNative.getProperty(o, name);
setProperty(JSObject o, name, value) => JsNative.setProperty(o, name, value);
callMethod(JSObject o, String method, List args) =>
JsNative.callMethod(o, method, args);
instanceof(JSObject o, Function type) => JsNative.instanceof(o, type);
callConstructor(JSObject constructor, List args) =>
JsNative.callConstructor(constructor, args);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,392 +0,0 @@
/**
* An API for storing data in the browser that can be queried with SQL.
*
* **Caution:** this specification is no longer actively maintained by the Web
* Applications Working Group and may be removed at any time.
* See [the W3C Web SQL Database specification](http://www.w3.org/TR/webdatabase/)
* for more information.
*
* The [dart:indexed_db] APIs is a recommended alternatives.
*/
library dart.dom.web_sql;
import 'dart:async';
import 'dart:collection' hide LinkedList, LinkedListEntry;
import 'dart:_internal';
import 'dart:html';
import 'dart:html_common';
import 'dart:nativewrappers';
import 'dart:_blink' as _blink;
import 'dart:js' as js;
// DO NOT EDIT - unless you are editing documentation as per:
// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
// Auto-generated dart:audio library.
// FIXME: Can we make this private?
@Deprecated("Internal Use Only")
final web_sqlBlinkMap = {
'Database': () => SqlDatabase.instanceRuntimeType,
'SQLError': () => SqlError.instanceRuntimeType,
'SQLResultSet': () => SqlResultSet.instanceRuntimeType,
'SQLResultSetRowList': () => SqlResultSetRowList.instanceRuntimeType,
'SQLTransaction': () => SqlTransaction.instanceRuntimeType,
};
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('SQLStatementCallback')
// http://www.w3.org/TR/webdatabase/#sqlstatementcallback
@Experimental() // deprecated
typedef void SqlStatementCallback(
SqlTransaction transaction, SqlResultSet resultSet);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('SQLStatementErrorCallback')
// http://www.w3.org/TR/webdatabase/#sqlstatementerrorcallback
@Experimental() // deprecated
typedef void SqlStatementErrorCallback(
SqlTransaction transaction, SqlError error);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('SQLTransactionCallback')
// http://www.w3.org/TR/webdatabase/#sqltransactioncallback
@Experimental() // deprecated
typedef void SqlTransactionCallback(SqlTransaction transaction);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('SQLTransactionErrorCallback')
// http://www.w3.org/TR/webdatabase/#sqltransactionerrorcallback
@Experimental() // deprecated
typedef void SqlTransactionErrorCallback(SqlError error);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Database')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/webdatabase/#asynchronous-database-api
@Experimental() // deprecated
class SqlDatabase extends DartHtmlDomObject {
// To suppress missing implicit constructor warnings.
factory SqlDatabase._() {
throw new UnsupportedError("Not supported");
}
@Deprecated("Internal Use Only")
external static Type get instanceRuntimeType;
@Deprecated("Internal Use Only")
SqlDatabase.internal_() {}
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('Database.version')
@DocsEditable()
String get version => _blink.BlinkDatabase.instance.version_Getter_(this);
void changeVersion(String oldVersion, String newVersion,
[SqlTransactionCallback callback,
SqlTransactionErrorCallback errorCallback,
VoidCallback successCallback]) {
if (successCallback != null) {
_blink.BlinkDatabase.instance.changeVersion_Callback_5_(this, oldVersion,
newVersion, callback, errorCallback, successCallback);
return;
}
if (errorCallback != null) {
_blink.BlinkDatabase.instance.changeVersion_Callback_4_(
this, oldVersion, newVersion, callback, errorCallback);
return;
}
if (callback != null) {
_blink.BlinkDatabase.instance
.changeVersion_Callback_3_(this, oldVersion, newVersion, callback);
return;
}
_blink.BlinkDatabase.instance
.changeVersion_Callback_2_(this, oldVersion, newVersion);
return;
}
void readTransaction(SqlTransactionCallback callback,
[SqlTransactionErrorCallback errorCallback,
VoidCallback successCallback]) {
if (successCallback != null) {
_blink.BlinkDatabase.instance.readTransaction_Callback_3_(
this, callback, errorCallback, successCallback);
return;
}
if (errorCallback != null) {
_blink.BlinkDatabase.instance
.readTransaction_Callback_2_(this, callback, errorCallback);
return;
}
_blink.BlinkDatabase.instance.readTransaction_Callback_1_(this, callback);
return;
}
void transaction(SqlTransactionCallback callback,
[SqlTransactionErrorCallback errorCallback,
VoidCallback successCallback]) {
if (successCallback != null) {
_blink.BlinkDatabase.instance.transaction_Callback_3_(
this, callback, errorCallback, successCallback);
return;
}
if (errorCallback != null) {
_blink.BlinkDatabase.instance
.transaction_Callback_2_(this, callback, errorCallback);
return;
}
_blink.BlinkDatabase.instance.transaction_Callback_1_(this, callback);
return;
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SQLError')
// http://www.w3.org/TR/webdatabase/#sqlerror
@Experimental() // deprecated
class SqlError extends DartHtmlDomObject {
// To suppress missing implicit constructor warnings.
factory SqlError._() {
throw new UnsupportedError("Not supported");
}
@Deprecated("Internal Use Only")
external static Type get instanceRuntimeType;
@Deprecated("Internal Use Only")
SqlError.internal_() {}
@DomName('SQLError.CONSTRAINT_ERR')
@DocsEditable()
static const int CONSTRAINT_ERR = 6;
@DomName('SQLError.DATABASE_ERR')
@DocsEditable()
static const int DATABASE_ERR = 1;
@DomName('SQLError.QUOTA_ERR')
@DocsEditable()
static const int QUOTA_ERR = 4;
@DomName('SQLError.SYNTAX_ERR')
@DocsEditable()
static const int SYNTAX_ERR = 5;
@DomName('SQLError.TIMEOUT_ERR')
@DocsEditable()
static const int TIMEOUT_ERR = 7;
@DomName('SQLError.TOO_LARGE_ERR')
@DocsEditable()
static const int TOO_LARGE_ERR = 3;
@DomName('SQLError.UNKNOWN_ERR')
@DocsEditable()
static const int UNKNOWN_ERR = 0;
@DomName('SQLError.VERSION_ERR')
@DocsEditable()
static const int VERSION_ERR = 2;
@DomName('SQLError.code')
@DocsEditable()
int get code => _blink.BlinkSQLError.instance.code_Getter_(this);
@DomName('SQLError.message')
@DocsEditable()
String get message => _blink.BlinkSQLError.instance.message_Getter_(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SQLResultSet')
// http://www.w3.org/TR/webdatabase/#sqlresultset
@Experimental() // deprecated
class SqlResultSet extends DartHtmlDomObject {
// To suppress missing implicit constructor warnings.
factory SqlResultSet._() {
throw new UnsupportedError("Not supported");
}
@Deprecated("Internal Use Only")
external static Type get instanceRuntimeType;
@Deprecated("Internal Use Only")
SqlResultSet.internal_() {}
@DomName('SQLResultSet.insertId')
@DocsEditable()
int get insertId => _blink.BlinkSQLResultSet.instance.insertId_Getter_(this);
@DomName('SQLResultSet.rows')
@DocsEditable()
SqlResultSetRowList get rows =>
_blink.BlinkSQLResultSet.instance.rows_Getter_(this);
@DomName('SQLResultSet.rowsAffected')
@DocsEditable()
int get rowsAffected =>
_blink.BlinkSQLResultSet.instance.rowsAffected_Getter_(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SQLResultSetRowList')
// http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist
@Experimental() // deprecated
class SqlResultSetRowList extends DartHtmlDomObject
with ListMixin<Map>, ImmutableListMixin<Map>
implements List<Map> {
// To suppress missing implicit constructor warnings.
factory SqlResultSetRowList._() {
throw new UnsupportedError("Not supported");
}
@Deprecated("Internal Use Only")
external static Type get instanceRuntimeType;
@Deprecated("Internal Use Only")
SqlResultSetRowList.internal_() {}
@DomName('SQLResultSetRowList.length')
@DocsEditable()
int get length =>
_blink.BlinkSQLResultSetRowList.instance.length_Getter_(this);
Map operator [](int index) {
if (index < 0 || index >= length) throw new RangeError.index(index, this);
return _nativeIndexedGetter(index);
}
Map _nativeIndexedGetter(int index) => convertNativeToDart_Dictionary(
_blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(this, index));
void operator []=(int index, Map value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<Map> mixins.
// Map is the element type.
set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
Map get first {
if (this.length > 0) {
return _nativeIndexedGetter(0);
}
throw new StateError("No elements");
}
Map get last {
int len = this.length;
if (len > 0) {
return _nativeIndexedGetter(len - 1);
}
throw new StateError("No elements");
}
Map get single {
int len = this.length;
if (len == 1) {
return _nativeIndexedGetter(0);
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
Map elementAt(int index) => this[index];
// -- end List<Map> mixins.
@DomName('SQLResultSetRowList.item')
@DocsEditable()
Object item(int index) => convertNativeToDart_Dictionary(
_blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(this, index));
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SQLTransaction')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/webdatabase/#sqltransaction
@deprecated // deprecated
class SqlTransaction extends DartHtmlDomObject {
// To suppress missing implicit constructor warnings.
factory SqlTransaction._() {
throw new UnsupportedError("Not supported");
}
@Deprecated("Internal Use Only")
external static Type get instanceRuntimeType;
@Deprecated("Internal Use Only")
SqlTransaction.internal_() {}
void executeSql(String sqlStatement,
[List arguments,
SqlStatementCallback callback,
SqlStatementErrorCallback errorCallback]) {
if (errorCallback != null) {
_blink.BlinkSQLTransaction.instance.executeSql_Callback_4_(
this, sqlStatement, arguments, callback, errorCallback);
return;
}
if (callback != null) {
_blink.BlinkSQLTransaction.instance
.executeSql_Callback_3_(this, sqlStatement, arguments, callback);
return;
}
if (arguments != null) {
_blink.BlinkSQLTransaction.instance
.executeSql_Callback_2_(this, sqlStatement, arguments);
return;
}
_blink.BlinkSQLTransaction.instance
.executeSql_Callback_1_(this, sqlStatement);
return;
}
}

View file

@ -196,7 +196,6 @@ LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: StaticWarnin
LayoutTests/fast/multicol/vertical-lr/float-truncation_t01: StaticWarning # Please triage this failure.
LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border_t01: StaticWarning # Please triage this failure.
LayoutTests/fast/multicol/vertical-rl/float-truncation_t01: StaticWarning # Please triage this failure.
LayoutTests/fast/overflow/scroll-vertical-not-horizontal_t01: StaticWarning # Please triage this failure.
LayoutTests/fast/ruby/after-doesnt-crash_t01: StaticWarning # Please triage this failure.
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-big-box-border-radius_t01: StaticWarning # Please triage this failure.
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon_t01: StaticWarning # Please triage this failure.

View file

@ -18,7 +18,7 @@ main() {
});
test("Access through dart:html", () {
var dartPerformance = js.JsNative.toTypedObject(js.context['performance']);
var dartPerformance = window.performance;
var dartEntries = dartPerformance.getEntries();
dartEntries.forEach((x) {
expect(x is PerformanceEntry, isTrue);

View file

@ -23,7 +23,6 @@ lib/html/html_common/html_common_dart2js: CompileTimeError # Issue 16522
lib/indexed_db/dart2js/indexed_db_dart2js: CompileTimeError # Issue 16522
lib/indexed_db/dartium/indexed_db_dartium: Skip # TODO: Remove Dartium
lib/js/dart2js/js_dart2js: CompileTimeError # Issue 16522
lib/js_util/dart2js/js_util_dart2js: CompileTimeError # Issue 16522
lib/svg/dart2js/svg_dart2js: CompileTimeError # Issue 16522
lib/svg/dartium/svg_dartium: Skip # TODO: Remove Dartium
lib/typed_data/dart2js/native_typed_data_dart2js: CompileTimeError # Issue 16522

View file

@ -43,7 +43,8 @@ final deps = new Set<Uri>();
File getInputFile(String path, {canBeMissing: false}) {
final file = new File(path);
if (!file.existsSync()) {
if (!canBeMissing) throw "patch_sdk.dart expects all inputs to exist";
if (!canBeMissing)
throw "patch_sdk.dart expects all inputs to exist, missing: $path";
return null;
}
deps.add(Uri.base.resolveUri(file.uri));