mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +00:00
[VM runtime] The 'checked' parameter of Isolate.spanwUri should control asserts
only, but not type checks in Dart2 strong mode (fixes #33120). Change-Id: Ib8ca63aa3113b80243b6f8eb4015cb5c24140a88 Reviewed-on: https://dart-review.googlesource.com/55442 Commit-Queue: Régis Crelier <regis@google.com> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This commit is contained in:
parent
f32509b849
commit
c60ea740cb
|
@ -357,10 +357,11 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 12) {
|
|||
// If we were passed a value then override the default flags state for
|
||||
// checked mode.
|
||||
if (!checked.IsNull()) {
|
||||
bool val = checked.value();
|
||||
bool is_checked = checked.value();
|
||||
Dart_IsolateFlags* flags = state->isolate_flags();
|
||||
flags->enable_asserts = val;
|
||||
flags->enable_type_checks = val;
|
||||
flags->enable_asserts = is_checked;
|
||||
// Do not enable type checks in strong mode.
|
||||
flags->enable_type_checks = is_checked && !flags->strong;
|
||||
}
|
||||
|
||||
ThreadPool::Task* spawn_task = new SpawnIsolateTask(state);
|
||||
|
|
|
@ -271,10 +271,13 @@ class Isolate {
|
|||
* before those methods can complete.
|
||||
*
|
||||
* If the [checked] parameter is set to `true` or `false`,
|
||||
* the new isolate will run code in checked mode,
|
||||
* respectively in production mode, if possible.
|
||||
* If the parameter is omitted, the new isolate will inherit the
|
||||
* value from the current isolate.
|
||||
* the new isolate will run code in checked mode (enabling asserts and type
|
||||
* checks), respectively in production mode (disabling asserts and type
|
||||
* checks), if possible. If the parameter is omitted, the new isolate will
|
||||
* inherit the value from the current isolate.
|
||||
*
|
||||
* In Dart2 strong mode, the `checked` parameter only controls asserts, but
|
||||
* not type checks.
|
||||
*
|
||||
* It may not always be possible to honor the `checked` parameter.
|
||||
* If the isolate code was pre-compiled, it may not be possible to change
|
||||
|
|
Loading…
Reference in a new issue