Permalink
Browse files

Fix the build

  • Loading branch information...
1 parent e11b91c commit 31e2ddf0390ddc386acc11405d13a06b46f405ff @wycats wycats committed Jun 5, 2012
Showing with 16 additions and 7 deletions.
  1. +13 −7 lib/ember/handlebars/assets/ember-precompiler.js
  2. +3 −0 test/test_helper.rb
View
20 lib/ember/handlebars/assets/ember-precompiler.js
@@ -1,16 +1,22 @@
// DOM
-var Element = {}
-Element.firstChild = function () { return Element };
-Element.innerHTML = function () { return Element };
+var Element = {};
+Element.firstChild = function () { return Element; };
+Element.innerHTML = function () { return Element; };
-var document = { createRange: false, createElement: function() { return Element } };
+var document = { createRange: false, createElement: function() { return Element; } };
var window = this;
this.document = document;
+// null out console.log and console.warn to avoid unexpected output
+if (window.console) {
+ window.console.warn = function() {};
+ window.console.log = function() {};
+}
+
//// jQuery
-var jQuery = window.jQuery = function() { return jQuery };
-jQuery.ready = function() { return jQuery };
-jQuery.inArray = function() { return jQuery };
+var jQuery = window.jQuery = function() { return jQuery; };
+jQuery.ready = function() { return jQuery; };
+jQuery.inArray = function() { return jQuery; };
jQuery.jquery = "1.7.2";
// Precompiler
View
3 test/test_helper.rb
@@ -7,6 +7,9 @@
require "fileutils"
Rails.backtrace_cleaner.remove_silencers!
+Rails.application.config.ember.handlebars_location = File.expand_path("../../vendor/ember/development/handlebars.js", __FILE__)
+Rails.application.config.ember.ember_location = File.expand_path("../../vendor/ember/development/ember.js", __FILE__)
+
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

0 comments on commit 31e2ddf

Please sign in to comment.