| Index: pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
|
| diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
|
| index 254a0f7cfe078cad4187e72c3701bf321475cbac..deec2b902efbf7fc6586c1f036a9e1e466f25557 100644
|
| --- a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
|
| +++ b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
|
| @@ -1438,6 +1438,21 @@ class Emitter implements js_emitter.Emitter {
|
| };
|
| }
|
|
|
| + if (#hasInstrumentation) {
|
| + var __record_buffer = []; // TODO(sigmund): define as a proper global.
|
| + function __record_use(id, name) {
|
| + if (__record_buffer.length == 0) {
|
| + window.setTimeout(function () {
|
| + var xhr = new XMLHttpRequest();
|
| + xhr.open("POST", "/coverage_uri_to_amend_by_server");
|
| + xhr.send(JSON.stringify(__record_buffer));
|
| + __record_buffer = [];
|
| + }, 1000);
|
| + }
|
| + __record_buffer.push([id, name]);
|
| + }
|
| + }
|
| +
|
| if (#isProgramSplit) {
|
| /// We collect all the global state, so it can be passed to the
|
| /// initializer of deferred files.
|
| @@ -1530,6 +1545,9 @@ class Emitter implements js_emitter.Emitter {
|
| """, {
|
| "disableVariableRenaming": js.comment("/* ::norenaming:: */"),
|
| "hasIncrementalSupport": compiler.hasIncrementalSupport,
|
| + // TODO(sigmund): add flag
|
| + "hasInstrumentation": const bool.fromEnvironment('instrumentForCoverage')
|
| + && compiler.dumpInfo,
|
| "helper": js('this.#', [namer.incrementalHelperName]),
|
| "schemaChange": buildSchemaChangeFunction(),
|
| "addMethod": buildIncrementalAddMethod(),
|
|
|