<commit_before>import 'dart:async';
import 'dart:html';

import 'package:meta/meta.dart';
import 'package:meta/dart2js.dart' as dart2js;

import 'package:angular/src/runtime.dart';
import 'package:angular/src/core/linker/app_view.dart';
import 'package:angular/src/core/linker/view_ref.dart';

import 'change_detection.dart';
import 'constants.dart';

/// A host for tracking the current application and stateful components.
///
/// This is a work-in-progress as a refactor in [#1071]
/// (https://github.com/dart-lang/angular/issues/1071).
///
/// This is expected to the base class for an `ApplicationRef`, and eventually
/// could be merged in directly to avoid having inheritance if necessary. For
/// now this is just for ease of testing and not breaking existing code.
abstract class ChangeDetectionHost {
  /// The current host being executed (synchronously) via [tick].
  static ChangeDetectionHost _current;

  /// **INTERNAL ONLY**: Whether a crash was detected during the last `tick()`.
  static bool get checkForCrashes => _current?._lastGuardedView != null;

  /// **INTERNAL ONLY**: Register a crash during [view.detectCrash].
  static void handleCrash(AppView<void> view, Object error, StackTrace trace) {
    final current = _current;
    assert(current != null);
    current
      .._lastGuardedView = view
      .._lastCaughtException = error
      .._lastCaughtTrace = trace;
  }
<commit_msg>#cleanup: remove WIP comment referencing closed issue<commit_after>import 'dart:async';
import 'dart:html';

import 'package:meta/meta.dart';
import 'package:meta/dart2js.dart' as dart2js;

import 'package:angular/src/runtime.dart';
import 'package:angular/src/core/linker/app_view.dart';
import 'package:angular/src/core/linker/view_ref.dart';

import 'change_detection.dart';
import 'constants.dart';

/// A host for tracking the current application and stateful components.
///
/// This is expected to the base class for an `ApplicationRef`, and eventually
/// could be merged in directly to avoid having inheritance if necessary. For
/// now this is just for ease of testing and not breaking existing code.
abstract class ChangeDetectionHost {
  /// The current host being executed (synchronously) via [tick].
  static ChangeDetectionHost _current;

  /// **INTERNAL ONLY**: Whether a crash was detected during the last `tick()`.
  static bool get checkForCrashes => _current?._lastGuardedView != null;

  /// **INTERNAL ONLY**: Register a crash during [view.detectCrash].
  static void handleCrash(AppView<void> view, Object error, StackTrace trace) {
    final current = _current;
    assert(current != null);
    current
      .._lastGuardedView = view
      .._lastCaughtException = error
      .._lastCaughtTrace = trace;
  }

{'fraction_non_alphanumeric': 0.11507647487254188, 'fraction_numerical': 0.004369992716678805, 'mean_word_length': 4.087037037037037, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3946617', 'n_tokens_mistral': 812, 'n_tokens_neox': 793, 'n_words': 266}