Skip to content

Commit

Permalink
Version 3.1.0-24.0.dev
Browse files Browse the repository at this point in the history
Merge 2da2520 into dev
  • Loading branch information
Dart CI committed Apr 20, 2023
2 parents 7d165bd + 2da2520 commit b0a6e22
Show file tree
Hide file tree
Showing 131 changed files with 938 additions and 628 deletions.
4 changes: 2 additions & 2 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ vars = {
# https://fuchsia.googlesource.com/integration/+/HEAD/toolchain
# If there are problems with the toolchain, contact fuchsia-toolchain@.
"clang_version": "git_revision:e8cfbfd05a951b85f80156dffc8eeecb34c7271c",
"gn_version": "git_revision:ffeea1b1fd070cb6a8d47154a03f8523486b50a7",
"gn_version": "git_revision:5a004f9427a050c6c393c07ddb85cba8ff3849fa",

# Update from https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/gn
"fuchsia_sdk_version": "version:12.20230314.2.1",
Expand Down Expand Up @@ -144,7 +144,7 @@ vars = {
"http_parser_rev": "bbe37dd228ec59f58a73df4b328ef747757165c7",
"intl_rev": "a958db01c90d041f0cd357d1732ae9813b620ee0",
"json_rpc_2_rev": "5da270592006e4d43fd5a6ac736829f955881240",
"linter_rev": "ca2a9fe07b399138b1f9d44e9e11e5198e0d8c05", # disable rev_sdk_deps.dart
"linter_rev": "82e7147cee2a62b881bcf9cc26f06e531510a92d", # disable rev_sdk_deps.dart
"lints_rev": "f09399a2574eb4e3f485881cf977fca72628f443",
"logging_rev": "787030a2b3d0d5d53ce57f1c7dc74f27ecb07b0b",
"markdown_rev": "d437c85188806fe2bfa4f3616159300ba9dc6d2a",
Expand Down
14 changes: 6 additions & 8 deletions pkg/_js_interop_checks/lib/js_interop_checks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class JsInteropChecks extends RecursiveVisitor {
final DiagnosticReporter<Message, LocatedMessage> _diagnosticsReporter;
final ExportChecker exportChecker;
final Procedure _functionToJSTarget;
final InlineExtensionIndex _inlineExtensionIndex = InlineExtensionIndex();
// Errors on constants need source information, so we use the surrounding
// `ConstantExpression` as the source.
ConstantExpression? _lastConstantExpression;
Expand All @@ -66,7 +67,6 @@ class JsInteropChecks extends RecursiveVisitor {
bool _classHasStaticInteropAnnotation = false;
bool _inTearoff = false;
bool _libraryHasJSAnnotation = false;
late InlineExtensionIndex _inlineExtensionIndex;
// TODO(joshualitt): These checks add value for our users, but unfortunately
// some backends support multiple native APIs. We should really make a neutral
// 'ExternalUsageVerifier` class, but until then we just disable this check on
Expand Down Expand Up @@ -324,7 +324,6 @@ class JsInteropChecks extends RecursiveVisitor {
_staticTypeContext.enterLibrary(node);
_libraryHasJSAnnotation = hasJSInteropAnnotation(node);
_libraryIsGlobalNamespace = false;
_inlineExtensionIndex = InlineExtensionIndex(node);
// Allow only Flutter and package:test to opt out from strict mode on
// Dart2Wasm.
final isSDKLibrary = node.importUri.isScheme('dart');
Expand Down Expand Up @@ -486,16 +485,15 @@ class JsInteropChecks extends RecursiveVisitor {
}

if (node.isExternal && node.isExtensionMember) {
final annotatable =
_inlineExtensionIndex.getExtensionAnnotatable(node.reference);
final annotatable = _inlineExtensionIndex.getExtensionAnnotatable(node);
if (annotatable != null &&
hasStaticInteropAnnotation(annotatable) &&
!_isAllowedCustomStaticInteropImplementation(node)) {
// If the extension has type parameters of its own, it copies those type
// parameters to the procedure's type parameters (in the front) as well.
// Ignore these for the analysis.
final extensionTypeParams =
_inlineExtensionIndex.getExtension(node.reference)!.typeParameters;
_inlineExtensionIndex.getExtension(node)!.typeParameters;
final procedureTypeParams = List.from(node.function.typeParameters);
procedureTypeParams.removeRange(0, extensionTypeParams.length);
if (procedureTypeParams.isNotEmpty ||
Expand Down Expand Up @@ -663,7 +661,7 @@ class JsInteropChecks extends RecursiveVisitor {
if (_isAllowedExternalUsage(member)) return;
if (member.isExtensionMember) {
final annotatable =
_inlineExtensionIndex.getExtensionAnnotatable(member.reference);
_inlineExtensionIndex.getExtensionAnnotatable(member);
if (annotatable == null || !hasNativeAnnotation(annotatable)) {
_diagnosticsReporter.report(
messageJsInteropExternalExtensionMemberOnTypeInvalid,
Expand Down Expand Up @@ -726,11 +724,11 @@ class JsInteropChecks extends RecursiveVisitor {
if (_classHasJSAnnotation) return true;
if (member.isExtensionMember) {
final annotatable =
_inlineExtensionIndex.getExtensionAnnotatable(member.reference);
_inlineExtensionIndex.getExtensionAnnotatable(member);
return annotatable != null && hasJSInteropAnnotation(annotatable);
}
if (member.isInlineClassMember) {
final cls = _inlineExtensionIndex.getInlineClass(member.reference);
final cls = _inlineExtensionIndex.getInlineClass(member);
return cls != null && hasJSInteropAnnotation(cls);
}
if (member.enclosingClass == null) {
Expand Down
Loading

0 comments on commit b0a6e22

Please sign in to comment.