<commit_before>// Copyright 2011 Google Inc. 
// see Purple/license.txt for BSD license
// <EMAIL>


define(['editorFeatureByOrion'], function(editor) {

  'use strict';
  var thePurple = window.purple;
  
  var compiler = thePurple.getPartByName('compilerByTraceur');
  
  var editorCompilerAssembly = new thePurple.PurplePart('editorCompilerAssembly'); 
  
  editorCompilerAssembly.initialize = function () {
      editor.initialize();
      compiler.initialize();
      compiler.connect(editor);
  };
  
  editorCompilerAssembly.destroy = function() {
      compiler.disconnect(editor);
      compiler.destroy();
      editor.destroy();
  };
  
  editorCompilerAssembly.partAdded = function(partInfo) {
    if (partInfo.value.getName() === 'compilerByTraceur') {
      this.initialize();
    }
  };

  editorCompilerAssembly.partRemoved = function(partInfo) {
    if (partInfo.value.getName() === 'compilerByTraceur') {
      this.destroy();
    }
  };

  thePurple.registerPart(editorCompilerAssembly);
  
  return editorCompilerAssembly;
});<commit_msg>avoid load order dependence by looking up the compiler after we have we know it has loaded.<commit_after>// Copyright 2011 Google Inc. 
// see Purple/license.txt for BSD license
// <EMAIL>


define(['editorFeatureByOrion'], function(editor) {

  'use strict';
  var thePurple = window.purple;
  
  
  var editorCompilerAssembly = new thePurple.PurplePart('editorCompilerAssembly'); 
  
  editorCompilerAssembly.initialize = function () {
      editor.initialize();
      this.compiler = thePurple.getPartByName('compilerByTraceur');
      this.compiler.initialize();
      this.compiler.connect(editor);
  };
  
  editorCompilerAssembly.destroy = function() {
      this.compiler.disconnect(editor);
      this.compiler.destroy();
      editor.destroy();
  };
  
  editorCompilerAssembly.partAdded = function(partInfo) {
    if (partInfo.value.getName() === 'compilerByTraceur') {
      this.initialize();
    }
  };

  editorCompilerAssembly.partRemoved = function(partInfo) {
    if (partInfo.value.getName() === 'compilerByTraceur') {
      this.destroy();
    }
  };

  thePurple.registerPart(editorCompilerAssembly);
  
  return editorCompilerAssembly;
});
{'fraction_non_alphanumeric': 0.12618296529968454, 'fraction_numerical': 0.003605227579990987, 'mean_word_length': 3.7435897435897436, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '6179230', 'n_tokens_mistral': 655, 'n_tokens_neox': 625, 'n_words': 115}