Files
sdk/pkg/meta/lib/dart2js.dart
T
Sigurd Meldgaard 3767d20e56 Bump language version for pkg/meta
Extracted from https://dart-review.googlesource.com/c/sdk/+/397164
Which migrates the sdk to resolve as a pub workspace

Pub workspaces requires a language version of 3.5.

Change-Id: If8e4f61fbf28c3fa9f22d2f2ed116fa179e30a22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412660
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2025-03-06 07:43:45 -08:00

44 lines
1.5 KiB
Dart

// Copyright (c) 2017, 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.
/// Constants for use in metadata annotations to provide hints to dart2js,
/// which is the compiler used by `dart compile js`.
///
/// This is an experimental feature and not expected to be useful except for low
/// level framework authors.
// ignore: unnecessary_library_name
library meta_dart2js;
/// An annotation for methods to request that dart2js does not inline the
/// method.
///
/// ```dart
/// import 'package:meta/dart2js.dart' as dart2js;
///
/// @dart2js.noInline
/// String text() => 'A String of unusual size';
/// ```
///
/// It is an error to use both `@noInline` and `@tryInline` on the same method.
const noInline = pragma('dart2js:noInline');
/// An annotation for methods to request that dart2js always inline the
/// method.
///
/// dart2js will attempt to inline the method regardless of its size. Even with
/// this annotation, there are conditions that can prevent dart2js from inlining
/// a method, including complex control flow.
///
/// ```dart
/// import 'package:meta/dart2js.dart' as dart2js;
///
/// @dart2js.tryInline
/// String bigMethod() {
/// for (int i in "Hello".runes) print(i);
/// }
/// ```
///
/// It is an error to use both `@noInline` and `@tryInline` on the same method.
const tryInline = pragma('dart2js:tryInline');