Skip to content

Commit

Permalink
Version 3.3.0-224.0.dev
Browse files Browse the repository at this point in the history
Merge d794b26 into dev
  • Loading branch information
Dart CI committed Dec 13, 2023
2 parents 114f2e8 + d794b26 commit 78dde11
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 52 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ vars = {
"material_color_utilities_rev": "799b6ba2f3f1c28c67cc7e0b4f18e0c7d7f3c03e",
"mime_rev": "56359b0c72e1a9a2e2b20ee5a34bacc18e113897",
"mockito_rev": "57a7c820ffae61e3df0dbc279ad98b92751175f0",
"native_rev": "5aeab2915167fd24ccb1241c07516b388fda2b9b", # https://github.com/dart-lang/native/issues/855
"native_rev": "b668ca94f551fcebdeb3ce9f822170facced55ae",
"package_config_rev": "33dd24659147bd7ed2fa87aeacc52d199be766b4",
"path_rev": "115ea2a4084881e7c76089a37abc01a067dfa6e3",
"pool_rev": "3c1bd422da311d95b65a04a5f28de2c0e8193692",
Expand Down
6 changes: 4 additions & 2 deletions pkg/dart2wasm/lib/translator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ class Translator with KernelNodes {
final Map<RecordShape, Class> recordClasses;

// Caches for when identical source constructs need a common representation.
final Map<w.StorageType, w.ArrayType> arrayTypeCache = {};
final Map<w.StorageType, w.ArrayType> immutableArrayTypeCache = {};
final Map<w.StorageType, w.ArrayType> mutableArrayTypeCache = {};
final Map<w.BaseFunction, w.Global> functionRefCache = {};
final Map<Procedure, ClosureImplementation> tearOffFunctionCache = {};

Expand Down Expand Up @@ -618,7 +619,8 @@ class Translator with KernelNodes {

w.ArrayType wasmArrayType(w.StorageType type, String name,
{bool mutable = true}) {
return arrayTypeCache.putIfAbsent(
final cache = mutable ? mutableArrayTypeCache : immutableArrayTypeCache;
return cache.putIfAbsent(
type,
() => m.types.defineArray("Array<$name>",
elementType: w.FieldType(type, mutable: mutable)));
Expand Down
7 changes: 3 additions & 4 deletions pkg/dartdev/lib/src/commands/run.dart
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,14 @@ class _DebuggingSession {
fullSdk ? sdk.devToolsBinaries : absolute(sdkDir, 'devtools');
String snapshotName = fullSdk
? sdk.ddsAotSnapshot
: absolute(sdkDir, 'gen', 'dds_aot.dart.snapshot');
: absolute(sdkDir, 'dds_aot.dart.snapshot');
String execName = sdk.dartAotRuntime;
if (!Sdk.checkArtifactExists(snapshotName)) {
// An AOT snapshot of dds is not available, we could
// be running on the ia32 platform so check for a regular
// kernel file being present.
snapshotName = fullSdk
? sdk.ddsSnapshot
: absolute(sdkDir, 'gen', 'dds.dart.snapshot');
snapshotName =
fullSdk ? sdk.ddsSnapshot : absolute(sdkDir, 'dds.dart.snapshot');
if (!Sdk.checkArtifactExists(snapshotName)) {
return false;
}
Expand Down
13 changes: 9 additions & 4 deletions pkg/dartdev/test/native_assets/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,15 @@ Future<void> copyTestProjects(Uri copyTargetUri, Logger logger) async {
final manifest = [
for (final path in manifestYaml.contents as YamlList) Uri(path: path)
];
final filesToCopy =
manifest.where((e) => e.pathSegments.last != 'pubspec.yaml').toList();
final filesToModify =
manifest.where((e) => e.pathSegments.last == 'pubspec.yaml').toList();
final filesToCopy = manifest
.where((e) => !(e.pathSegments.last.startsWith('pubspec') &&
e.pathSegments.last.endsWith('.yaml')))
.toList();
final filesToModify = manifest
.where((e) =>
e.pathSegments.last.startsWith('pubspec') &&
e.pathSegments.last.endsWith('.yaml'))
.toList();

for (final pathToCopy in filesToCopy) {
final sourceFile = File.fromUri(testProjectsUri.resolveUri(pathToCopy));
Expand Down
16 changes: 8 additions & 8 deletions sdk/lib/_internal/wasm/lib/js_interop_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ extension NullableUndefineableJSAnyExtension on JSAny? {
"this API should not be used when compiling to Wasm.");

@patch
bool typeofEquals(String type) =>
_box<JSBoolean>(js_helper.JS<WasmExternRef?>('(o, t) => typeof o === t',
this.toExternRef, type.toJS.toExternRef))
.toDart;
bool typeofEquals(String type) => js_helper
.JS<WasmI32>(
'(o, t) => typeof o === t', this.toExternRef, type.toJS.toExternRef)
.toBool();

@patch
Object? dartify() => js_util.dartify(this);
Expand All @@ -65,10 +65,10 @@ extension NullableObjectUtilExtension on Object? {
@patch
extension JSObjectUtilExtension on JSObject {
@patch
bool instanceof(JSFunction constructor) =>
_box<JSBoolean>(js_helper.JS<WasmExternRef?>(
'(o, c) => o instanceof c', toExternRef, constructor.toExternRef))
.toDart;
bool instanceof(JSFunction constructor) => js_helper
.JS<WasmI32>(
'(o, c) => o instanceof c', toExternRef, constructor.toExternRef)
.toBool();
}

/// [JSExportedDartFunction] <-> [Function]
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 3
PATCH 0
PRERELEASE 223
PRERELEASE 224
PRERELEASE_PATCH 0
2 changes: 1 addition & 1 deletion tools/dom/scripts/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ cd ./tools/dom/scripts

# Calculate, emit, and format the bindings.
BINDINGS="../web_library_bindings.dart"
dart ./web_library_bindings_emitter.dart $BINDINGS
dart --enable-asserts ./web_library_bindings_emitter.dart $BINDINGS
dart format $BINDINGS
22 changes: 20 additions & 2 deletions tools/dom/scripts/web_library_bindings_emitter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,34 @@ void main(List<String> args) {
'dart:web_gl'
};

const Set<String> duplicateClassNames = {
'ImageElement',
'ScriptElement',
'StyleElement',
'TitleElement'
};

for (var library in component.libraries) {
if (webLibraries.contains(library.importUri.toString())) {
for (var cls in library.classes) {
if (cls.isMixinApplication) continue;
// All strings in the maps are annotated with quotes, so that we print
// proper Dart code when we print the maps.
var clsName = "'${cls.name}'";
var nativeTypes = getNativeNames(cls);
nativeTypes = nativeTypes.map((name) => "'$name'").toList();
var nativeTypes = getNativeNames(cls).map((name) => "'$name'").toList();
if (nativeTypes.isEmpty) nativeTypes = [clsName];
// There are a couple of cases where there are two classes with the same
// name. They are all element classes bound to an `HTML` and an `SVG`
// version. For now, ignore the `SVG` version, as they're unused in
// google3 and most of them are marked unstable, and their `HTML`
// variants are much more common.
// TODO(srujzs): Remove this if we decide to deprecate these classes.
if (duplicateClassNames.contains(cls.name)) {
if (nativeTypes.length == 1 && nativeTypes[0] == "'SVG${cls.name}'") {
continue;
}
}
assert(!dartTypeToNativeTypes.containsKey(clsName));
dartTypeToNativeTypes[clsName] = SplayTreeSet.from(nativeTypes);

var nativePropToDartProp = SplayTreeMap<String, SplayTreeSet<String>>();
Expand Down
13 changes: 13 additions & 0 deletions tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ part of $LIBRARYNAME;
* A client-side XHR request for getting data from a URL,
* formally known as XMLHttpRequest.
*
* **Note:** You should avoid directly using `HttpRequest` to make HTTP
* requests. You can use `HttpRequest` indirectly through the
* [`BrowserClient`](https://pub.dev/documentation/http/latest/browser_client/BrowserClient-class.html)
* adapter in [`package:http`](https://pub.dev/packages/http).
*
* Using a higher-level library, like
* [`package:http`](https://pub.dev/packages/http), allows you to switch
* implementations with minimal changes to your code. For example,
* `package:http`
* [`Client`](https://pub.dev/documentation/http/latest/http/Client-class.html)
* has implementations for the browser and implementations that use
* platform native HTTP clients on Android and iOS.
*
* HttpRequest can be used to obtain data from HTTP and FTP protocols,
* and is useful for AJAX-style page updates.
*
Expand Down
56 changes: 27 additions & 29 deletions tools/dom/web_library_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3486,15 +3486,6 @@ final Map<String, Map<String, Set<String>>> nativeTypeToDartMembers = {
'systemLanguage': {'systemLanguage'},
'transform': {'transform'}
},
'SVGImageElement': {
'async': {'async'},
'height': {'height'},
'href': {'href'},
'preserveAspectRatio': {'preserveAspectRatio'},
'width': {'width'},
'x': {'x'},
'y': {'y'}
},
'SVGLength': {
'convertToSpecifiedUnits': {'convertToSpecifiedUnits'},
'newValueSpecifiedUnits': {'newValueSpecifiedUnits'},
Expand Down Expand Up @@ -3678,10 +3669,6 @@ final Map<String, Map<String, Set<String>>> nativeTypeToDartMembers = {
'y': {'y'},
'zoomAndPan': {'zoomAndPan'}
},
'SVGScriptElement': {
'href': {'href'},
'type': {'type'}
},
'SVGStopElement': {
'offset': {'gradientOffset'}
},
Expand All @@ -3695,12 +3682,6 @@ final Map<String, Map<String, Set<String>>> nativeTypeToDartMembers = {
'removeItem': {'removeItem'},
'replaceItem': {'replaceItem'}
},
'SVGStyleElement': {
'disabled': {'disabled'},
'media': {'media'},
'sheet': {'sheet'},
'type': {'type'}
},
'SVGSymbolElement': {
'preserveAspectRatio': {'preserveAspectRatio'},
'viewBox': {'viewBox'}
Expand Down Expand Up @@ -6537,13 +6518,21 @@ final Map<String, Map<String, String>> dartTypeToNativeMembers = {
'ImageCapture': {'track': 'track'},
'ImageData': {'data': 'data', 'height': 'height', 'width': 'width'},
'ImageElement': {
'alt': 'alt',
'async': 'async',
'complete': 'complete',
'crossOrigin': 'crossOrigin',
'currentSrc': 'currentSrc',
'height': 'height',
'href': 'href',
'preserveAspectRatio': 'preserveAspectRatio',
'width': 'width',
'x': 'x',
'y': 'y'
'isMap': 'isMap',
'naturalHeight': 'naturalHeight',
'naturalWidth': 'naturalWidth',
'referrerPolicy': 'referrerPolicy',
'sizes': 'sizes',
'src': 'src',
'srcset': 'srcset',
'useMap': 'useMap',
'width': 'width'
},
'Index': {
'getAll': 'getAll',
Expand Down Expand Up @@ -8143,7 +8132,16 @@ final Map<String, Map<String, String>> dartTypeToNativeMembers = {
'width': 'width'
},
'ScreenOrientation': {'angle': 'angle', 'type': 'type', 'unlock': 'unlock'},
'ScriptElement': {'href': 'href', 'type': 'type'},
'ScriptElement': {
'async': 'async',
'charset': 'charset',
'crossOrigin': 'crossOrigin',
'defer': 'defer',
'integrity': 'integrity',
'noModule': 'noModule',
'src': 'src',
'type': 'type'
},
'ScriptProcessorNode': {
'bufferSize': 'bufferSize',
'setEventListener': 'setEventListener'
Expand Down Expand Up @@ -9465,7 +9463,7 @@ final Map<String, Set<String>> dartTypeToNativeTypes = {
'ImageButtonInputElement': {'ImageButtonInputElement'},
'ImageCapture': {'ImageCapture'},
'ImageData': {'ImageData'},
'ImageElement': {'SVGImageElement'},
'ImageElement': {'HTMLImageElement'},
'ImmutableListMixin': {'ImmutableListMixin'},
'Index': {'IDBIndex'},
'InputDeviceCapabilities': {'InputDeviceCapabilities'},
Expand Down Expand Up @@ -9737,7 +9735,7 @@ final Map<String, Set<String>> dartTypeToNativeTypes = {
'Sampler': {'WebGLSampler'},
'Screen': {'Screen'},
'ScreenOrientation': {'ScreenOrientation'},
'ScriptElement': {'SVGScriptElement'},
'ScriptElement': {'HTMLScriptElement'},
'ScriptProcessorNode': {'JavaScriptAudioNode', 'ScriptProcessorNode'},
'ScrollAlignment': {'ScrollAlignment'},
'ScrollState': {'ScrollState'},
Expand Down Expand Up @@ -9783,7 +9781,7 @@ final Map<String, Set<String>> dartTypeToNativeTypes = {
'StorageEvent': {'StorageEvent'},
'StorageManager': {'StorageManager'},
'StringList': {'SVGStringList'},
'StyleElement': {'SVGStyleElement'},
'StyleElement': {'HTMLStyleElement'},
'StyleMedia': {'StyleMedia'},
'StylePropertyMap': {'StylePropertyMap'},
'StylePropertyMapReadonly': {'StylePropertyMapReadonly'},
Expand Down Expand Up @@ -9831,7 +9829,7 @@ final Map<String, Set<String>> dartTypeToNativeTypes = {
'TimeInputElement': {'TimeInputElement'},
'TimeRanges': {'TimeRanges'},
'TimerQueryExt': {'WebGLTimerQueryEXT'},
'TitleElement': {'SVGTitleElement'},
'TitleElement': {'HTMLTitleElement'},
'Touch': {'Touch'},
'TouchEvent': {'TouchEvent'},
'TouchList': {'TouchList'},
Expand Down

0 comments on commit 78dde11

Please sign in to comment.