Files
sdk/tests/try/web/mock_try.dart
T
ahe@google.com f97f17c76e Add "point of interest" app for command-line testing of dart2js type information.
For now, the app only prints the location of an offset given at command line.

Example usage:

dart -p$BUILD_DIRECTORY/ReleaseIA32/packages/ poi.dart DART_FILE OFFSET

R=kasperl@google.com

Review URL: https://codereview.chromium.org//386563002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38114 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-10 10:37:40 +00:00

44 lines
1.1 KiB
Dart

// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:html' show
DivElement,
MutationObserver,
document;
import 'package:try/src/interaction_manager.dart' show
InteractionManager;
import 'package:try/src/ui.dart' show
hackDiv,
mainEditorPane,
observer;
import 'package:try/src/user_option.dart' show
UserOption;
InteractionManager mockTryDartInteraction() {
UserOption.storage = {};
InteractionManager interaction = new InteractionManager();
hackDiv = new DivElement();
mainEditorPane = new DivElement()
..style.whiteSpace = 'pre'
..contentEditable = 'true';
observer = new MutationObserver(interaction.onMutation);
observer.observe(
mainEditorPane, childList: true, characterData: true, subtree: true);
document.body.nodes.addAll([mainEditorPane, hackDiv]);
return interaction;
}
void clearEditorPaneWithoutNotifications() {
mainEditorPane.nodes.clear();
observer.takeRecords();
}