mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
c768f80a96
Calls to methods annotated with `@pragma('dart2js:resource-identifier')` are tracked, with their primitive constant arguments, through to the `.js` file which contains the call. - JavaScript annotations are attached to the JavaScript AST node for the call. - At the time of `.js` file printing, the JavaScript annotations are collected and attributed to the file. This allows the construction of a map from `.js` files to the 'resource identifiers' contained in the file. - Alongside the `main.js` file the resource identifiers are emitted in a file called `main.js.resources.json`. This is controlled by the `--write-resources` command line option. - Serialization of JavaScript ASTs now serializes the attached JavaScript annotations. - The internal method used to implement deferred library loading is annotated, to allow analysis of which deferred library parts load other libraries. pkg/js_ast was tweaked to make the pkg/js_ast was tweaked to make the - pkg/js_ast was tweaked to make propagating the JavaScript annotations through the async transforms easier. TODO: - Annotate const constructors - Add golden-style tests Change-Id: Iea77550e22ee98f81dca61dfd713c09f734583d2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284492 Reviewed-by: Nate Biggs <natebiggs@google.com> Commit-Queue: Stephen Adams <sra@google.com> |
||
---|---|---|
.. | ||
lib | ||
test | ||
analysis_options.yaml | ||
LICENSE | ||
OWNERS | ||
pubspec.yaml | ||
README.md |
js_ast
A library for creating JavaScript ASTs from templates.