[ddc] Stubbing package:dart2js_runtime_metrics

This allows the package to be discoverable across web backends

Change-Id: I7d870a7232543d3b719d47de1424017d7f578434
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244261
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
Mark Zhou 2022-05-11 22:31:45 +00:00 committed by Commit Bot
parent 41ba014616
commit 143c6df41b
4 changed files with 19 additions and 1 deletions

View file

@ -133,7 +133,9 @@ class DevCompilerTarget extends Target {
@override
bool allowPlatformPrivateLibraryAccess(Uri importer, Uri imported) =>
super.allowPlatformPrivateLibraryAccess(importer, imported) ||
_allowedTestLibrary(importer);
_allowedTestLibrary(importer) ||
(importer.isScheme('package') &&
importer.path.startsWith('dart2js_runtime_metrics/'));
@override
bool get nativeExtensionExpectsString => false;

View file

@ -0,0 +1,10 @@
// Copyright (c) 2022, 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.
// This file is a stub to allow dart:_dart2js_runtime_metrics to be discovered
// across web contexts.
get runtimeMetrics => throw UnimplementedError();
get startupMetrics => throw UnimplementedError();

View file

@ -433,6 +433,9 @@
"_native_typed_data": {
"uri": "_internal/js_dev_runtime/private/native_typed_data.dart"
},
"_dart2js_runtime_metrics": {
"uri": "_internal/js_dev_runtime/private/runtime_metrics.dart"
},
"async": {
"uri": "async/async.dart",
"patches": "_internal/js_dev_runtime/patch/async_patch.dart"

View file

@ -399,6 +399,9 @@ dartdevc:
_native_typed_data:
uri: "_internal/js_dev_runtime/private/native_typed_data.dart"
_dart2js_runtime_metrics:
uri: "_internal/js_dev_runtime/private/runtime_metrics.dart"
async:
uri: "async/async.dart"
patches: "_internal/js_dev_runtime/patch/async_patch.dart"