Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate.spawnUri "checked" documentation needs some cleanup #40432

Open
natebosch opened this issue Feb 1, 2020 · 2 comments
Open

Isolate.spawnUri "checked" documentation needs some cleanup #40432

natebosch opened this issue Feb 1, 2020 · 2 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-isolate type-documentation A request to add or improve documentation

Comments

@natebosch
Copy link
Member

* If the [checked] parameter is set to `true` or `false`,
* 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
* the checked mode setting dynamically.
* In that case, the `checked` parameter is ignored.
*
* WARNING: The [checked] parameter is not implemented on all platforms yet.

  • We should drop "Dart 2 strong mode" - it is the only mode.
  • The phrasing of the first sentence is very confusing.
  • We should drop references to "type checks" since they are always enabled.
  • What does "If this isolate code was pre-compiled". Does that refer to using a URI pointing to a kernel file?
  • The warning about it not being supported on all platforms should be expanded. What platforms isn't is supported on? AOT?
@natebosch natebosch added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-isolate labels Feb 1, 2020
@aam
Copy link
Contributor

aam commented Feb 3, 2020

What does "If this isolate code was pre-compiled". Does that refer to using a URI pointing to a kernel file?

Yes. Assertions from dart code are included/dropped by the kernel compiler. If compilation was already done and VM spawnUri points at result kernel file, then this flag won't affect anything.

The warning about it not being supported on all platforms should be expanded. What platforms isn't is supported on? AOT?

Right, current limitations are:

  • when targeting VM in AOT configuration you will get an Unsupported exception if you attempt to use spawnUri;
  • when you target Web(using dart2js), then invocation of spawnUri in your dart app will result in UnsupportedError exception.

@natebosch
Copy link
Member Author

when you target Web(using dart2js), then invocation of spawnUri in your dart app will result in UnsupportedError exception.

Our build system prevents importing dart:isolate on the web. These APIs should not be reachable with dart2js.

@lrhn lrhn added the type-documentation A request to add or improve documentation label Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-isolate type-documentation A request to add or improve documentation
Projects
None yet
Development

No branches or pull requests

3 participants