77775c5292
This is for compatibility with Kernel, as well as fixing several bugs, and generally being a more robust architecture. This may also perform better than the current design. Notable fixes include several issues around deferred classes. Change-Id: I1b6f44ebdf6304b10b47d19026156a25e04146ef Reviewed-on: https://dart-review.googlesource.com/16337 Commit-Queue: Jenny Messerly <jmesserly@google.com> Reviewed-by: Leaf Petersen <leafp@google.com>
84 lines
2.5 KiB
Dart
84 lines
2.5 KiB
Dart
// 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.
|
|
|
|
part of dart._js_helper;
|
|
|
|
/// Tells the optimizing compiler to always inline the annotated method.
|
|
class ForceInline {
|
|
const ForceInline();
|
|
}
|
|
|
|
/// Marks a variable or API to be non-nullable.
|
|
/// ****CAUTION******
|
|
/// This is currently unchecked, and hence should never be used
|
|
/// on any public interface where user code could subclass, implement,
|
|
/// or otherwise cause the contract to be violated.
|
|
/// TODO(leafp): Consider adding static checking and exposing
|
|
/// this to user code.
|
|
class NotNull {
|
|
const NotNull();
|
|
}
|
|
|
|
const notNull = const NotNull();
|
|
|
|
/// Marks a generic function or static method API to be not reified.
|
|
/// ****CAUTION******
|
|
/// This is currently unchecked, and hence should be used very carefully for
|
|
/// internal SDK APIs only.
|
|
class NoReifyGeneric {
|
|
const NoReifyGeneric();
|
|
}
|
|
|
|
/// Enables/disables reificiation of functions within the body of this function.
|
|
/// ****CAUTION******
|
|
/// This is currently unchecked, and hence should be used very carefully for
|
|
/// internal SDK APIs only.
|
|
class ReifyFunctionTypes {
|
|
final bool value;
|
|
const ReifyFunctionTypes(this.value);
|
|
}
|
|
|
|
/// Tells the development compiler to check a variable for null at its
|
|
/// declaration point, and then to assume that the variable is non-null
|
|
/// from that point forward.
|
|
/// ****CAUTION******
|
|
/// This is currently unchecked, and hence will not catch re-assignments
|
|
/// of a variable with null
|
|
class NullCheck {
|
|
const NullCheck();
|
|
}
|
|
|
|
const nullCheck = const NullCheck();
|
|
|
|
/// Tells the optimizing compiler that the annotated method cannot throw.
|
|
/// Requires @NoInline() to function correctly.
|
|
class NoThrows {
|
|
const NoThrows();
|
|
}
|
|
|
|
/// Tells the optimizing compiler to not inline the annotated method.
|
|
class NoInline {
|
|
const NoInline();
|
|
}
|
|
|
|
/// Marks a class as native and defines its JavaScript name(s).
|
|
class Native {
|
|
final String name;
|
|
const Native(this.name);
|
|
}
|
|
|
|
class JsPeerInterface {
|
|
/// The JavaScript type that we should match the API of.
|
|
/// Used for classes where Dart subclasses should be callable from JavaScript
|
|
/// matching the JavaScript calling conventions.
|
|
final String name;
|
|
const JsPeerInterface({this.name});
|
|
}
|
|
|
|
/// A Dart interface may only be implemented by a native JavaScript object
|
|
/// if it is marked with this annotation.
|
|
class SupportJsExtensionMethods {
|
|
const SupportJsExtensionMethods();
|
|
}
|