Version 2.16.0-30.0.dev
Merge commit '1ade4ab96ff841cc847b6a043ceeb5063efc8591' into 'dev'
diff --git a/pkg/analyzer/lib/src/error/best_practices_verifier.dart b/pkg/analyzer/lib/src/error/best_practices_verifier.dart
index 5468b6a..45dce24 100644
--- a/pkg/analyzer/lib/src/error/best_practices_verifier.dart
+++ b/pkg/analyzer/lib/src/error/best_practices_verifier.dart
@@ -42,7 +42,7 @@
/// Instances of the class `BestPracticesVerifier` traverse an AST structure
/// looking for violations of Dart best practices.
class BestPracticesVerifier extends RecursiveAstVisitor<void> {
- static const String _TO_INT_METHOD_NAME = "toInt";
+ static const String toIntMethodName = "toInt";
/// The class containing the AST nodes being visited, or `null` if we are not
/// in the scope of a class.
@@ -81,7 +81,7 @@
final WorkspacePackage? _workspacePackage;
/// The [LinterContext] used for possible const calculations.
- late final LinterContext _linterContext;
+ final LinterContext _linterContext;
/// Is `true` if the library being analyzed is non-nullable by default.
final bool _isNonNullableByDefault;
@@ -89,9 +89,10 @@
/// True if inference failures should be reported, otherwise false.
final bool _strictInference;
- /// Create a new instance of the [BestPracticesVerifier].
- ///
- /// @param errorReporter the error reporter
+ /// Whether [_currentLibrary] is part of its containing package's public API.
+ late final bool _inPublicPackageApi = _workspacePackage != null &&
+ _workspacePackage!.sourceIsInPublicApi(_currentLibrary.source);
+
BestPracticesVerifier(
this._errorReporter,
TypeProviderImpl typeProvider,
@@ -117,28 +118,22 @@
_errorHandlerVerifier =
ErrorHandlerVerifier(_errorReporter, typeProvider, typeSystem),
_nullSafeApiVerifier = NullSafeApiVerifier(_errorReporter, typeSystem),
- _workspacePackage = workspacePackage {
+ _workspacePackage = workspacePackage,
+ _linterContext = LinterContextImpl(
+ [],
+ LinterContextUnit(content, unit),
+ declaredVariables,
+ typeProvider,
+ typeSystem,
+ inheritanceManager,
+ analysisOptions,
+ workspacePackage,
+ ) {
_deprecatedVerifier.pushInDeprecatedValue(_currentLibrary.hasDeprecated);
_inDoNotStoreMember = _currentLibrary.hasDoNotStore;
-
- _linterContext = LinterContextImpl(
- [],
- LinterContextUnit(content, unit),
- declaredVariables,
- typeProvider,
- _typeSystem,
- _inheritanceManager,
- analysisOptions,
- _workspacePackage,
- );
_invalidAccessVerifier._inTestDirectory = _linterContext.inTestDir(unit);
}
- bool get _inPublicPackageApi {
- return _workspacePackage != null &&
- _workspacePackage!.sourceIsInPublicApi(_currentLibrary.source);
- }
-
@override
void visitAnnotation(Annotation node) {
var element = node.elementAnnotation;
@@ -403,7 +398,7 @@
@override
void visitConstructorDeclaration(ConstructorDeclaration node) {
var element = node.declaredElement as ConstructorElementImpl;
- if (!_isNonNullableByDefault && node.declaredElement!.isFactory) {
+ if (!_isNonNullableByDefault && element.isFactory) {
if (node.body is BlockFunctionBody) {
// Check the block for a return statement, if not, create the hint.
if (!ExitDetector.exits(node.body)) {
@@ -904,7 +899,7 @@
_wrapParenthesizedExpression(parent);
var grandParent = parenthesizedExpression.parent;
if (grandParent is MethodInvocation) {
- if (_TO_INT_METHOD_NAME == grandParent.methodName.name &&
+ if (toIntMethodName == grandParent.methodName.name &&
grandParent.argumentList.arguments.isEmpty) {
_errorReporter.reportErrorForNode(
HintCode.DIVISION_OPTIMIZATION, grandParent);
@@ -984,8 +979,6 @@
return false;
}
- /// Return `true` if the given class [element] defines a non-final instance
- /// field.
Iterable<String> nonFinalInstanceFields(ClassElement element) {
return element.fields
.where((FieldElement field) =>
@@ -993,8 +986,6 @@
.map((FieldElement field) => '${element.name}.${field.name}');
}
- /// Return `true` if the given class [element] defines or inherits a
- /// non-final field.
Iterable<String> definedOrInheritedNonFinalInstanceFields(
ClassElement element, HashSet<ClassElement> visited) {
Iterable<String> nonFinalFields = [];
@@ -1808,16 +1799,15 @@
final LibraryElement _library;
final WorkspacePackage? _workspacePackage;
- late final bool _inTemplateSource;
+ final bool _inTemplateSource;
late final bool _inTestDirectory;
ClassElement? _enclosingClass;
_InvalidAccessVerifier(
- this._errorReporter, this._library, this._workspacePackage) {
- var path = _library.source.fullName;
- _inTemplateSource = path.contains(_templateExtension);
- }
+ this._errorReporter, this._library, this._workspacePackage)
+ : _inTemplateSource =
+ _library.source.fullName.contains(_templateExtension);
/// Produces a hint if [identifier] is accessed from an invalid location.
///
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 5d189df..e79e6c4 100644
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -381,9 +381,9 @@
* See the additional discussion under "Propagating Errors" at the
* beginning of this file.
*
- * \param An error handle (See Dart_IsError)
+ * \param handle An error handle (See Dart_IsError)
*
- * \return On success, this function does not return. On failure, the
+ * On success, this function does not return. On failure, the
* process is terminated.
*/
DART_EXPORT void Dart_PropagateError(Dart_Handle handle);
@@ -443,9 +443,6 @@
*
* \param obj1 A persistent handle whose value needs to be set.
* \param obj2 An object whose value needs to be set to the persistent handle.
- *
- * \return Success if the persistent handle was set
- * Otherwise, returns an error.
*/
DART_EXPORT void Dart_SetPersistentHandle(Dart_PersistentHandle obj1,
Dart_Handle obj2);
@@ -586,7 +583,7 @@
*
* \return The version string for the embedded Dart VM.
*/
-DART_EXPORT const char* Dart_VersionString();
+DART_EXPORT const char* Dart_VersionString(void);
/**
* Isolate specific flags are set when creating a new isolate using the
@@ -772,45 +769,63 @@
* This function could be used to dispose of native resources that
* are associated and attached to the thread, in order to avoid leaks.
*/
-typedef void (*Dart_ThreadExitCallback)();
+typedef void (*Dart_ThreadExitCallback)(void);
/**
- * Callbacks provided by the embedder for file operations. If the
- * embedder does not allow file operations these callbacks can be
+ * Opens a file for reading or writing.
+ *
+ * Callback provided by the embedder for file operations. If the
+ * embedder does not allow file operations this callback can be
* NULL.
*
- * Dart_FileOpenCallback - opens a file for reading or writing.
* \param name The name of the file to open.
* \param write A boolean variable which indicates if the file is to
* opened for writing. If there is an existing file it needs to truncated.
+ */
+typedef void* (*Dart_FileOpenCallback)(const char* name, bool write);
+
+/**
+ * Read contents of file.
*
- * Dart_FileReadCallback - Read contents of file.
+ * Callback provided by the embedder for file operations. If the
+ * embedder does not allow file operations this callback can be
+ * NULL.
+ *
* \param data Buffer allocated in the callback into which the contents
* of the file are read into. It is the responsibility of the caller to
* free this buffer.
* \param file_length A variable into which the length of the file is returned.
* In the case of an error this value would be -1.
* \param stream Handle to the opened file.
- *
- * Dart_FileWriteCallback - Write data into file.
- * \param data Buffer which needs to be written into the file.
- * \param length Length of the buffer.
- * \param stream Handle to the opened file.
- *
- * Dart_FileCloseCallback - Closes the opened file.
- * \param stream Handle to the opened file.
- *
*/
-typedef void* (*Dart_FileOpenCallback)(const char* name, bool write);
-
typedef void (*Dart_FileReadCallback)(uint8_t** data,
intptr_t* file_length,
void* stream);
+/**
+ * Write data into file.
+ *
+ * Callback provided by the embedder for file operations. If the
+ * embedder does not allow file operations this callback can be
+ * NULL.
+ *
+ * \param data Buffer which needs to be written into the file.
+ * \param length Length of the buffer.
+ * \param stream Handle to the opened file.
+ */
typedef void (*Dart_FileWriteCallback)(const void* data,
intptr_t length,
void* stream);
+/**
+ * Closes the opened file.
+ *
+ * Callback provided by the embedder for file operations. If the
+ * embedder does not allow file operations this callback can be
+ * NULL.
+ *
+ * \param stream Handle to the opened file.
+ */
typedef void (*Dart_FileCloseCallback)(void* stream);
typedef bool (*Dart_EntropySource)(uint8_t* buffer, intptr_t length);
@@ -825,7 +840,7 @@
* \return The embedder must return a handle to a Uint8List containing an
* uncompressed tar archive or null.
*/
-typedef Dart_Handle (*Dart_GetVMServiceAssetsArchive)();
+typedef Dart_Handle (*Dart_GetVMServiceAssetsArchive)(void);
/**
* The current version of the Dart_InitializeFlags. Should be incremented every
@@ -903,53 +918,86 @@
/**
* Describes how to initialize the VM. Used with Dart_Initialize.
- *
- * \param version Identifies the version of the struct used by the client.
- * should be initialized to DART_INITIALIZE_PARAMS_CURRENT_VERSION.
- * \param vm_isolate_snapshot A buffer containing a snapshot of the VM isolate
- * or NULL if no snapshot is provided. If provided, the buffer must remain
- * valid until Dart_Cleanup returns.
- * \param instructions_snapshot A buffer containing a snapshot of precompiled
- * instructions, or NULL if no snapshot is provided. If provided, the buffer
- * must remain valid until Dart_Cleanup returns.
- * \param initialize_isolate A function to be called during isolate
- * initialization inside an existing isolate group.
- * See Dart_InitializeIsolateCallback.
- * \param create_group A function to be called during isolate group creation.
- * See Dart_IsolateGroupCreateCallback.
- * \param shutdown A function to be called right before an isolate is shutdown.
- * See Dart_IsolateShutdownCallback.
- * \param cleanup A function to be called after an isolate was shutdown.
- * See Dart_IsolateCleanupCallback.
- * \param cleanup_group A function to be called after an isolate group is shutdown.
- * See Dart_IsolateGroupCleanupCallback.
- * \param get_service_assets A function to be called by the service isolate when
- * it requires the vmservice assets archive.
- * See Dart_GetVMServiceAssetsArchive.
- * \param code_observer An external code observer callback function.
- * The observer can be invoked as early as during the Dart_Initialize() call.
- * \param post_task A task scheduling callback function.
- * See Dart_PostTaskCallback.
*/
typedef struct {
+ /**
+ * Identifies the version of the struct used by the client.
+ * should be initialized to DART_INITIALIZE_PARAMS_CURRENT_VERSION.
+ */
int32_t version;
+
+ /**
+ * A buffer containing snapshot data, or NULL if no snapshot is provided.
+ *
+ * If provided, the buffer must remain valid until Dart_Cleanup returns.
+ */
const uint8_t* vm_snapshot_data;
+
+ /**
+ * A buffer containing a snapshot of precompiled instructions, or NULL if
+ * no snapshot is provided.
+ *
+ * If provided, the buffer must remain valid until Dart_Cleanup returns.
+ */
const uint8_t* vm_snapshot_instructions;
+
+ /**
+ * A function to be called during isolate group creation.
+ * See Dart_IsolateGroupCreateCallback.
+ */
Dart_IsolateGroupCreateCallback create_group;
+
+ /**
+ * A function to be called during isolate
+ * initialization inside an existing isolate group.
+ * See Dart_InitializeIsolateCallback.
+ */
Dart_InitializeIsolateCallback initialize_isolate;
+
+ /**
+ * A function to be called right before an isolate is shutdown.
+ * See Dart_IsolateShutdownCallback.
+ */
Dart_IsolateShutdownCallback shutdown_isolate;
+
+ /**
+ * A function to be called after an isolate was shutdown.
+ * See Dart_IsolateCleanupCallback.
+ */
Dart_IsolateCleanupCallback cleanup_isolate;
+
+ /**
+ * A function to be called after an isolate group is
+ * shutdown. See Dart_IsolateGroupCleanupCallback.
+ */
Dart_IsolateGroupCleanupCallback cleanup_group;
+
Dart_ThreadExitCallback thread_exit;
Dart_FileOpenCallback file_open;
Dart_FileReadCallback file_read;
Dart_FileWriteCallback file_write;
Dart_FileCloseCallback file_close;
Dart_EntropySource entropy_source;
+
+ /**
+ * A function to be called by the service isolate when it requires the
+ * vmservice assets archive. See Dart_GetVMServiceAssetsArchive.
+ */
Dart_GetVMServiceAssetsArchive get_service_assets;
+
bool start_kernel_isolate;
+
+ /**
+ * An external code observer callback function. The observer can be invoked
+ * as early as during the Dart_Initialize() call.
+ */
Dart_CodeObserver* code_observer;
+
+ /**
+ * A task scheduling callback function. See Dart_PostTaskCallback.
+ */
Dart_PostTaskCallback post_task;
+
void* post_task_data;
} Dart_InitializeParams;
@@ -974,7 +1022,7 @@
* NOTE: This function must not be called on a thread that was created by the VM
* itself.
*/
-DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_Cleanup();
+DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_Cleanup(void);
/**
* Sets command line flags. Should be called before Dart_Initialize.
@@ -1017,15 +1065,17 @@
* Requires there to be no current isolate.
*
* \param script_uri The main source file or snapshot this isolate will load.
- * The VM will provide this URI to the Dart_IsolateGroupCreateCallback when a child
- * isolate is created by Isolate.spawn. The embedder should use a URI that
- * allows it to load the same program into such a child isolate.
+ * The VM will provide this URI to the Dart_IsolateGroupCreateCallback when a
+ * child isolate is created by Isolate.spawn. The embedder should use a URI
+ * that allows it to load the same program into such a child isolate.
* \param name A short name for the isolate to improve debugging messages.
* Typically of the format 'foo.dart:main()'.
- * \param isolate_snapshot_data
- * \param isolate_snapshot_instructions Buffers containing a snapshot of the
- * isolate or NULL if no snapshot is provided. If provided, the buffers must
+ * \param isolate_snapshot_data Buffer containing the snapshot data of the
+ * isolate or NULL if no snapshot is provided. If provided, the buffer must
* remain valid until the isolate shuts down.
+ * \param isolate_snapshot_instructions Buffer containing the snapshot
+ * instructions of the isolate or NULL if no snapshot is provided. If
+ * provided, the buffer must remain valid until the isolate shuts down.
* \param flags Pointer to VM specific flags or NULL for default flags.
* \param isolate_group_data Embedder group data. This data can be obtained
* by calling Dart_IsolateGroupData and will be passed to the
@@ -1090,14 +1140,14 @@
* Requires there to be no current isolate.
*
* \param script_uri The main source file or snapshot this isolate will load.
- * The VM will provide this URI to the Dart_IsolateGroupCreateCallback when a child
- * isolate is created by Isolate.spawn. The embedder should use a URI that
+ * The VM will provide this URI to the Dart_IsolateGroupCreateCallback when a
+ * child isolate is created by Isolate.spawn. The embedder should use a URI that
* allows it to load the same program into such a child isolate.
* \param name A short name for the isolate to improve debugging messages.
* Typically of the format 'foo.dart:main()'.
- * \param kernel_buffer
- * \param kernel_buffer_size A buffer which contains a kernel/DIL program. Must
+ * \param kernel_buffer A buffer which contains a kernel/DIL program. Must
* remain valid until isolate shutdown.
+ * \param kernel_buffer_size The size of `kernel_buffer`.
* \param flags Pointer to VM specific flags or NULL for default flags.
* \param isolate_group_data Embedder group data. This data can be obtained
* by calling Dart_IsolateGroupData and will be passed to the
@@ -1128,20 +1178,20 @@
*
* Requires there to be a current isolate.
*/
-DART_EXPORT void Dart_ShutdownIsolate();
+DART_EXPORT void Dart_ShutdownIsolate(void);
/* TODO(turnidge): Document behavior when there is no current isolate. */
/**
* Returns the current isolate. Will return NULL if there is no
* current isolate.
*/
-DART_EXPORT Dart_Isolate Dart_CurrentIsolate();
+DART_EXPORT Dart_Isolate Dart_CurrentIsolate(void);
/**
* Returns the callback data associated with the current isolate. This
* data was set when the isolate got created or initialized.
*/
-DART_EXPORT void* Dart_CurrentIsolateData();
+DART_EXPORT void* Dart_CurrentIsolateData(void);
/**
* Returns the callback data associated with the given isolate. This
@@ -1153,13 +1203,13 @@
* Returns the current isolate group. Will return NULL if there is no
* current isolate group.
*/
-DART_EXPORT Dart_IsolateGroup Dart_CurrentIsolateGroup();
+DART_EXPORT Dart_IsolateGroup Dart_CurrentIsolateGroup(void);
/**
* Returns the callback data associated with the current isolate group. This
* data was passed to the isolate group when it was created.
*/
-DART_EXPORT void* Dart_CurrentIsolateGroupData();
+DART_EXPORT void* Dart_CurrentIsolateGroupData(void);
/**
* Returns the callback data associated with the specified isolate group. This
@@ -1175,7 +1225,7 @@
* This name is unique to each isolate and should only be used to make
* debugging messages more comprehensible.
*/
-DART_EXPORT Dart_Handle Dart_DebugName();
+DART_EXPORT Dart_Handle Dart_DebugName(void);
/**
* Returns the ID for an isolate which is used to query the service protocol.
@@ -1236,12 +1286,12 @@
*
* Does not require a current isolate. Only valid after calling Dart_Initialize.
*/
-DART_EXPORT void Dart_NotifyLowMemory();
+DART_EXPORT void Dart_NotifyLowMemory(void);
/**
* Starts the CPU sampling profiler.
*/
-DART_EXPORT void Dart_StartProfiling();
+DART_EXPORT void Dart_StartProfiling(void);
/**
* Stops the CPU sampling profiler.
@@ -1250,7 +1300,7 @@
* returns due to the asynchronous nature of the implementation on some
* platforms.
*/
-DART_EXPORT void Dart_StopProfiling();
+DART_EXPORT void Dart_StopProfiling(void);
/**
* Notifies the VM that the current thread should not be profiled until a
@@ -1261,7 +1311,7 @@
* to make a blocking call and wants to avoid unnecessary interrupts by
* the profiler.
*/
-DART_EXPORT void Dart_ThreadDisableProfiling();
+DART_EXPORT void Dart_ThreadDisableProfiling(void);
/**
* Notifies the VM that the current thread should be profiled.
@@ -1271,7 +1321,7 @@
*
* NOTE: By default, if a thread has entered an isolate it will be profiled.
*/
-DART_EXPORT void Dart_ThreadEnableProfiling();
+DART_EXPORT void Dart_ThreadEnableProfiling(void);
/**
* Register symbol information for the Dart VM's profiler and crash dumps.
@@ -1289,7 +1339,7 @@
*
* Requires there to be a current isolate.
*/
-DART_EXPORT void Dart_ExitIsolate();
+DART_EXPORT void Dart_ExitIsolate(void);
/* TODO(turnidge): We don't want users of the api to be able to exit a
* "pure" dart isolate. Implement and document. */
@@ -1304,12 +1354,17 @@
* Requires there to be a current isolate. Not available in the precompiled
* runtime (check Dart_IsPrecompiledRuntime).
*
- * \param buffer Returns a pointer to a buffer containing the
- * snapshot. This buffer is scope allocated and is only valid
+ * \param vm_snapshot_data_buffer Returns a pointer to a buffer containing the
+ * vm snapshot. This buffer is scope allocated and is only valid
* until the next call to Dart_ExitScope.
- * \param size Returns the size of the buffer.
+ * \param vm_snapshot_data_size Returns the size of vm_snapshot_data_buffer.
+ * \param isolate_snapshot_data_buffer Returns a pointer to a buffer containing
+ * the isolate snapshot. This buffer is scope allocated and is only valid
+ * until the next call to Dart_ExitScope.
+ * \param isolate_snapshot_data_size Returns the size of
+ * isolate_snapshot_data_buffer.
* \param is_core Create a snapshot containing core libraries.
- * Such snapshot should be agnostic to null safety mode.
+ * Such snapshot should be agnostic to null safety mode.
*
* \return A valid handle if no error occurs during the operation.
*/
@@ -1392,7 +1447,7 @@
*
* \return The current message notify callback for the isolate.
*/
-DART_EXPORT Dart_MessageNotifyCallback Dart_GetMessageNotifyCallback();
+DART_EXPORT Dart_MessageNotifyCallback Dart_GetMessageNotifyCallback(void);
/**
* The VM's default message handler supports pausing an isolate before it
@@ -1418,7 +1473,7 @@
*
* \return A boolean value indicating if pause on start was requested.
*/
-DART_EXPORT bool Dart_ShouldPauseOnStart();
+DART_EXPORT bool Dart_ShouldPauseOnStart(void);
/**
* Override the VM flag `--pause-isolates-on-start` for the current isolate.
@@ -1434,7 +1489,7 @@
*
* \return A boolean value indicating if the isolate is paused on start.
*/
-DART_EXPORT bool Dart_IsPausedOnStart();
+DART_EXPORT bool Dart_IsPausedOnStart(void);
/**
* Called when the embedder has paused the current isolate on start and when
@@ -1449,7 +1504,7 @@
*
* \return A boolean value indicating if pause on exit was requested.
*/
-DART_EXPORT bool Dart_ShouldPauseOnExit();
+DART_EXPORT bool Dart_ShouldPauseOnExit(void);
/**
* Override the VM flag `--pause-isolates-on-exit` for the current isolate.
@@ -1464,7 +1519,7 @@
*
* \return A boolean value indicating if the isolate is paused on exit.
*/
-DART_EXPORT bool Dart_IsPausedOnExit();
+DART_EXPORT bool Dart_IsPausedOnExit(void);
/**
* Called when the embedder has paused the current isolate on exit and when
@@ -1488,14 +1543,14 @@
/**
* Does the current isolate have a sticky error?
*/
-DART_EXPORT bool Dart_HasStickyError();
+DART_EXPORT bool Dart_HasStickyError(void);
/**
* Gets the sticky error for the current isolate.
*
* \return A handle to the sticky error object or null.
*/
-DART_EXPORT Dart_Handle Dart_GetStickyError();
+DART_EXPORT Dart_Handle Dart_GetStickyError(void);
/**
* Handles the next pending message for the current isolate.
@@ -1504,7 +1559,7 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_HandleMessage();
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_HandleMessage(void);
/**
* Drains the microtask queue, then blocks the calling thread until the current
@@ -1530,14 +1585,14 @@
* \return true if the vm service requests the program resume
* execution, false otherwise
*/
-DART_EXPORT bool Dart_HandleServiceMessages();
+DART_EXPORT bool Dart_HandleServiceMessages(void);
/**
* Does the current isolate have pending service messages?
*
* \return true if the isolate has pending service messages, false otherwise.
*/
-DART_EXPORT bool Dart_HasServiceMessages();
+DART_EXPORT bool Dart_HasServiceMessages(void);
/**
* Processes any incoming messages for the current isolate.
@@ -1555,7 +1610,7 @@
* exception or other error occurs while processing messages, an
* error handle is returned.
*/
-DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_RunLoop();
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_RunLoop(void);
/**
* Lets the VM run message processing for the isolate.
@@ -1586,14 +1641,14 @@
/**
* Gets the main port id for the current isolate.
*/
-DART_EXPORT Dart_Port Dart_GetMainPortId();
+DART_EXPORT Dart_Port Dart_GetMainPortId(void);
/**
* Does the current isolate have live ReceivePorts?
*
* A ReceivePort is live when it has not been closed.
*/
-DART_EXPORT bool Dart_HasLivePorts();
+DART_EXPORT bool Dart_HasLivePorts(void);
/**
* Posts a message for some isolate. The message is a serialized
@@ -1601,7 +1656,7 @@
*
* Requires there to be a current isolate.
*
- * \param port The destination port.
+ * \param port_id The destination port.
* \param object An object from the current isolate.
*
* \return True if the message was posted.
@@ -1643,7 +1698,7 @@
*
* Requires there to be a current isolate.
*/
-DART_EXPORT void Dart_EnterScope();
+DART_EXPORT void Dart_EnterScope(void);
/**
* Exits a scope.
@@ -1652,7 +1707,7 @@
*
* Requires there to be a current isolate.
*/
-DART_EXPORT void Dart_ExitScope();
+DART_EXPORT void Dart_ExitScope(void);
/**
* The Dart VM uses "zone allocation" for temporary structures. Zones
@@ -1689,7 +1744,7 @@
*
* \return A handle to the null object.
*/
-DART_EXPORT Dart_Handle Dart_Null();
+DART_EXPORT Dart_Handle Dart_Null(void);
/**
* Is this object null?
@@ -1701,7 +1756,7 @@
*
* \return A handle to the empty string object.
*/
-DART_EXPORT Dart_Handle Dart_EmptyString();
+DART_EXPORT Dart_Handle Dart_EmptyString(void);
/**
* Returns types that are not classes, and which therefore cannot be looked up
@@ -1709,9 +1764,9 @@
*
* \return A handle to the dynamic, void or Never type.
*/
-DART_EXPORT Dart_Handle Dart_TypeDynamic();
-DART_EXPORT Dart_Handle Dart_TypeVoid();
-DART_EXPORT Dart_Handle Dart_TypeNever();
+DART_EXPORT Dart_Handle Dart_TypeDynamic(void);
+DART_EXPORT Dart_Handle Dart_TypeVoid(void);
+DART_EXPORT Dart_Handle Dart_TypeNever(void);
/**
* Checks if the two objects are equal.
@@ -2020,7 +2075,7 @@
*
* \return A handle to the True object.
*/
-DART_EXPORT Dart_Handle Dart_True();
+DART_EXPORT Dart_Handle Dart_True(void);
/**
* Returns the False object.
@@ -2029,7 +2084,7 @@
*
* \return A handle to the False object.
*/
-DART_EXPORT Dart_Handle Dart_False();
+DART_EXPORT Dart_Handle Dart_False(void);
/**
* Returns a Boolean with the provided value.
@@ -2073,7 +2128,7 @@
* UTF-8 encoded characters and '\0' is considered as a termination
* character).
*
- * \param value A C String
+ * \param str A C String
*
* \return The String object if no error occurs. Otherwise returns
* an error handle.
@@ -2230,7 +2285,7 @@
* Gets the storage size in bytes of a String.
*
* \param str A String.
- * \param length Returns the storage size in bytes of the String.
+ * \param size Returns the storage size in bytes of the String.
* This is the size in bytes needed to store the String.
*
* \return A valid handle if no error occurs during the operation.
@@ -2377,7 +2432,7 @@
*
* May generate an unhandled exception error.
*
- * \param array A List.
+ * \param list A List.
* \param index A valid index into the List.
* \param value The Object to put in the List.
*
@@ -2542,7 +2597,7 @@
/**
* Returns a ByteBuffer object for the typed data.
*
- * \param type_data The TypedData object.
+ * \param typed_data The TypedData object.
*
* \return The ByteBuffer object if no error occurs. Otherwise returns
* an error handle.
@@ -2701,13 +2756,13 @@
* Invokes a Generative Constructor on an object that was previously
* allocated using Dart_Allocate/Dart_AllocateWithNativeFields.
*
- * The 'target' parameter must be an object.
+ * The 'object' parameter must be an object.
*
* This function ignores visibility (leading underscores in names).
*
* May generate an unhandled exception error.
*
- * \param target An object.
+ * \param object An object.
* \param name The name of the constructor to invoke.
* Use Dart_Null() or Dart_EmptyString() to invoke the unnamed constructor.
* \param number_of_arguments Size of the arguments array.
@@ -2985,7 +3040,7 @@
/**
* Gets an integer native argument at some index.
* \param args Native arguments structure.
- * \param arg_index Index of the desired argument in the structure above.
+ * \param index Index of the desired argument in the structure above.
* \param value Returns the integer value if the argument is an Integer.
* \return Success if no error occurs. Otherwise returns an error handle.
*/
@@ -2996,7 +3051,7 @@
/**
* Gets a boolean native argument at some index.
* \param args Native arguments structure.
- * \param arg_index Index of the desired argument in the structure above.
+ * \param index Index of the desired argument in the structure above.
* \param value Returns the boolean value if the argument is a Boolean.
* \return Success if no error occurs. Otherwise returns an error handle.
*/
@@ -3007,7 +3062,7 @@
/**
* Gets a double native argument at some index.
* \param args Native arguments structure.
- * \param arg_index Index of the desired argument in the structure above.
+ * \param index Index of the desired argument in the structure above.
* \param value Returns the double value if the argument is a double.
* \return Success if no error occurs. Otherwise returns an error handle.
*/
@@ -3319,9 +3374,9 @@
*
* Requires there to be no current root library.
*
- * \param buffer A buffer which contains a kernel binary (see
+ * \param kernel_buffer A buffer which contains a kernel binary (see
* pkg/kernel/binary.md). Must remain valid until isolate group shutdown.
- * \param buffer_size Length of the passed in buffer.
+ * \param kernel_size Length of the passed in buffer.
*
* \return A handle to the root library, or an error.
*/
@@ -3337,7 +3392,7 @@
*
* \return Returns the root Library for the current isolate or Dart_Null().
*/
-DART_EXPORT Dart_Handle Dart_RootLibrary();
+DART_EXPORT Dart_Handle Dart_RootLibrary(void);
/**
* Sets the root library for the current isolate.
@@ -3465,7 +3520,7 @@
/**
* \return An array of libraries.
*/
-DART_EXPORT Dart_Handle Dart_GetLoadedLibraries();
+DART_EXPORT Dart_Handle Dart_GetLoadedLibraries(void);
DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url);
/* TODO(turnidge): Consider returning Dart_Null() when the library is
@@ -3488,9 +3543,9 @@
* Called by the embedder to load a partial program. Does not set the root
* library.
*
- * \param buffer A buffer which contains a kernel binary (see
+ * \param kernel_buffer A buffer which contains a kernel binary (see
* pkg/kernel/binary.md). Must remain valid until isolate shutdown.
- * \param buffer_size Length of the passed in buffer.
+ * \param kernel_buffer_size Length of the passed in buffer.
*
* \return A handle to the main library of the compilation unit, or an error.
*/
@@ -3590,8 +3645,8 @@
} Dart_KernelCompilationVerbosityLevel;
DART_EXPORT bool Dart_IsKernelIsolate(Dart_Isolate isolate);
-DART_EXPORT bool Dart_KernelIsolateIsRunning();
-DART_EXPORT Dart_Port Dart_KernelPort();
+DART_EXPORT bool Dart_KernelIsolateIsRunning(void);
+DART_EXPORT Dart_Port Dart_KernelPort(void);
/**
* Compiles the given `script_uri` to a kernel file.
@@ -3634,7 +3689,7 @@
const char* source;
} Dart_SourceFile;
-DART_EXPORT Dart_KernelCompilationResult Dart_KernelListDependencies();
+DART_EXPORT Dart_KernelCompilationResult Dart_KernelListDependencies(void);
/**
* Sets the kernel buffer which will be used to load Dart SDK sources
@@ -3669,17 +3724,19 @@
* process was launched, this is used to correctly resolve the path specified
* for package_config.
*
- * \param snapshot_data
- *
- * \param snapshot_instructions Buffers containing a snapshot of the
+ * \param snapshot_data Buffer containing the snapshot data of the
* isolate or NULL if no snapshot is provided. If provided, the buffers must
* remain valid until the isolate shuts down.
*
- * \param kernel_buffer
+ * \param snapshot_instructions Buffer containing the snapshot instructions of
+ * the isolate or NULL if no snapshot is provided. If provided, the buffers
+ * must remain valid until the isolate shuts down.
*
- * \param kernel_buffer_size A buffer which contains a kernel/DIL program. Must
+ * \param kernel_buffer A buffer which contains a kernel/DIL program. Must
* remain valid until isolate shutdown.
*
+ * \param kernel_buffer_size The size of `kernel_buffer`.
+ *
* \return Returns true if the null safety is opted in by the input being
* run `script_uri`, `snapshot_data` or `kernel_buffer`.
*
@@ -3740,7 +3797,7 @@
* \return An error handle if a compilation error or runtime error running const
* constructors was encountered.
*/
-DART_EXPORT Dart_Handle Dart_Precompile();
+DART_EXPORT Dart_Handle Dart_Precompile(void);
typedef void (*Dart_CreateLoadingUnitCallback)(
void* callback_data,
@@ -3878,7 +3935,7 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_SortClasses();
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_SortClasses(void);
/**
* Creates a snapshot that caches compiled code and type feedback for faster
@@ -3938,7 +3995,7 @@
* not from any other kind of snapshot or from source (that is, the VM was
* compiled with DART_PRECOMPILED_RUNTIME).
*/
-DART_EXPORT bool Dart_IsPrecompiledRuntime();
+DART_EXPORT bool Dart_IsPrecompiledRuntime(void);
/**
* Print a native stack trace. Used for crash handling.
@@ -3953,6 +4010,6 @@
* Indicate that the process is about to abort, and the Dart VM should not
* attempt to cleanup resources.
*/
-DART_EXPORT void Dart_PrepareToAbort();
+DART_EXPORT void Dart_PrepareToAbort(void);
#endif /* INCLUDE_DART_API_H_ */ /* NOLINT */
diff --git a/runtime/include/dart_api_dl.h b/runtime/include/dart_api_dl.h
index 1521df2..804b281 100644
--- a/runtime/include/dart_api_dl.h
+++ b/runtime/include/dart_api_dl.h
@@ -96,8 +96,8 @@
F(Dart_SendPortGetId, Dart_Handle, \
(Dart_Handle port, Dart_Port_DL * port_id)) \
/* Scopes */ \
- F(Dart_EnterScope, void, ()) \
- F(Dart_ExitScope, void, ())
+ F(Dart_EnterScope, void, (void)) \
+ F(Dart_ExitScope, void, (void))
#define DART_API_ALL_DL_SYMBOLS(F) \
DART_NATIVE_API_DL_SYMBOLS(F) \
diff --git a/runtime/include/dart_native_api.h b/runtime/include/dart_native_api.h
index f99fff1..66e5f93 100644
--- a/runtime/include/dart_native_api.h
+++ b/runtime/include/dart_native_api.h
@@ -181,12 +181,12 @@
*
* TODO(turnidge): Document.
*/
-DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_CompileAll();
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_CompileAll(void);
/**
* Finalizes all classes.
*/
-DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_FinalizeAllClasses();
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_FinalizeAllClasses(void);
/* This function is intentionally undocumented.
*
diff --git a/runtime/include/internal/dart_api_dl_impl.h b/runtime/include/internal/dart_api_dl_impl.h
index ad13a4b..e4a5689 100644
--- a/runtime/include/internal/dart_api_dl_impl.h
+++ b/runtime/include/internal/dart_api_dl_impl.h
@@ -9,7 +9,7 @@
typedef struct {
const char* name;
- void (*function)();
+ void (*function)(void);
} DartApiEntry;
typedef struct {
diff --git a/tools/VERSION b/tools/VERSION
index 81577f0..59d4a27 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 16
PATCH 0
-PRERELEASE 29
+PRERELEASE 30
PRERELEASE_PATCH 0
\ No newline at end of file