Skip to content
This repository
Browse code

update with latest build tools from ember

  • Loading branch information...
commit 1a2c4b195e6facd6ca574bcc7c3d98006885fb4e 1 parent 601cbe2
Paul Chavard tchak authored
25 .jshintrc
... ... @@ -1,30 +1,31 @@
1 1 {
2 2 "predef": [
3   - "jasmine",
4   - "spyOn",
5   - "it",
6 3 "console",
7   - "describe",
8   - "expect",
9   - "beforeEach",
10   - "waits",
11   - "waitsFor",
12   - "runs",
13 4 "Ember",
14 5 "DS",
  6 + "Handlebars",
  7 + "Metamorph",
15 8 "ember_assert",
  9 + "ember_warn",
  10 + "ember_deprecate",
  11 + "ember_deprecateFunc",
16 12 "require",
17 13 "equal",
18 14 "test",
  15 + "testBoth",
  16 + "testWithDefault",
19 17 "raises",
20 18 "deepEqual",
21 19 "start",
22 20 "stop",
23 21 "ok",
24   - "strictEqual"
  22 + "strictEqual",
  23 + "module",
  24 + "expect",
  25 + "minispade"
25 26 ],
26 27
27   - "node" : true,
  28 + "node" : false,
28 29 "es5" : true,
29 30 "browser" : true,
30 31
@@ -35,7 +36,7 @@
35 36 "eqeqeq": true,
36 37 "evil": true,
37 38 "forin": false,
38   - "immed": true,
  39 + "immed": false,
39 40 "laxbreak": false,
40 41 "newcap": true,
41 42 "noarg": true,
27 Assetfile
... ... @@ -1,7 +1,6 @@
1 1 require "rake-pipeline-web-filters"
2 2 require "json"
3 3 require "uglifier"
4   -require "./neuter"
5 4
6 5 class EmberProductionFilter < Rake::Pipeline::Filter
7 6 def generate_output(inputs, output)
@@ -23,6 +22,16 @@ class EmberLicenseFilter < Rake::Pipeline::Filter
23 22 end
24 23 end
25 24
  25 +class JSHintRC < Rake::Pipeline::Filter
  26 + def generate_output(inputs, output)
  27 + inputs.each do |input|
  28 + file = File.read(input.fullpath)
  29 + jshintrc = File.read(".jshintrc")
  30 + output.write "var JSHINTRC = #{jshintrc};\n\n#{file}"
  31 + end
  32 + end
  33 +end
  34 +
26 35 distros = {
27 36 :full => %w(ember-data)
28 37 }
@@ -43,6 +52,10 @@ input "packages" do
43 52
44 53 concat "ember-data-tests.js"
45 54 end
  55 +
  56 + match "ember-data-tests.js" do
  57 + filter JSHintRC
  58 + end
46 59 end
47 60
48 61 input "packages" do
@@ -61,7 +74,17 @@ end
61 74
62 75 input "packages" do
63 76 match "*/lib/**/main.js" do
64   - neuter do |filename|
  77 + neuter(
  78 + :additional_dependencies => proc { |input|
  79 + Dir.glob(File.join(File.dirname(input.fullpath),'**','*.js'))
  80 + },
  81 + :path_transform => proc { |path, input|
  82 + package, path = path.split('/', 2)
  83 + current_package = input.path.split('/', 2)[0]
  84 + current_package == package && path ? File.join(package, "lib", "#{path}.js") : nil
  85 + },
  86 + :closure_wrap => true
  87 + ) do |filename|
65 88 File.join("modules/", filename.gsub('/lib/main.js', '.js'))
66 89 end
67 90 end
16 Gemfile.lock
... ... @@ -1,6 +1,6 @@
1 1 GIT
2 2 remote: https://github.com/livingsocial/rake-pipeline.git
3   - revision: f71caeb1406dafd6af5ab8453db8c5ac53947c92
  3 + revision: b70ca6cad7655e58d13031f3e24df7dfc74f9030
4 4 specs:
5 5 rake-pipeline (0.6.0)
6 6 rake (~> 0.9.0)
@@ -16,7 +16,7 @@ GIT
16 16
17 17 GIT
18 18 remote: https://github.com/wycats/rake-pipeline-web-filters.git
19   - revision: fe752a8cfdbb318b746fd76fd3c10dd8b8f29891
  19 + revision: ba0b8a00356b4c854930a8e849b5629d51ffd70f
20 20 specs:
21 21 rake-pipeline-web-filters (0.6.0)
22 22 rack
@@ -27,7 +27,7 @@ GEM
27 27 specs:
28 28 colored (1.2)
29 29 confparser (0.0.2.1)
30   - execjs (1.2.13)
  30 + execjs (1.3.0)
31 31 multi_json (~> 1.0)
32 32 faster_xml_simple (0.5.0)
33 33 libxml-ruby (>= 0.3.8.4)
@@ -35,17 +35,17 @@ GEM
35 35 confparser
36 36 net-github-upload (>= 0.0.6)
37 37 httpclient (2.2.4)
38   - json (1.6.4)
  38 + json (1.6.6)
39 39 kicker (2.5.0)
40 40 rb-fsevent
41   - libxml-ruby (2.2.2)
42   - multi_json (1.0.4)
43   - net-github-upload (0.0.7)
  41 + libxml-ruby (2.3.2)
  42 + multi_json (1.2.0)
  43 + net-github-upload (0.0.8)
44 44 faster_xml_simple
45 45 httpclient
46 46 json
47 47 nokogiri (>= 1.4.0)
48   - nokogiri (1.5.0)
  48 + nokogiri (1.5.2)
49 49 rack (1.4.1)
50 50 rake (0.9.2.2)
51 51 rb-fsevent (0.9.0)
35 Rakefile
... ... @@ -1,4 +1,4 @@
1   -abort "Please use Ruby 1.9 to build Ember.js Data!" if RUBY_VERSION !~ /^1\.9/
  1 +abort "Please use Ruby 1.9 to build Ember.js!" if RUBY_VERSION !~ /^1\.9/
2 2
3 3 require "bundler/setup"
4 4 require "erb"
@@ -6,6 +6,10 @@ require 'rake-pipeline'
6 6 require "ember_docs/cli"
7 7 require "colored"
8 8
  9 +def pipeline
  10 + Rake::Pipeline::Project.new("Assetfile")
  11 +end
  12 +
9 13 desc "Strip trailing whitespace for JavaScript files in packages"
10 14 task :strip_whitespace do
11 15 Dir["packages/**/*.js"].each do |name|
@@ -18,29 +22,18 @@ end
18 22
19 23 desc "Build ember-data.js"
20 24 task :dist do
21   - Rake::Pipeline::Project.new("Assetfile").invoke
  25 + puts "Building Ember Data..."
  26 + pipeline.invoke
  27 + puts "Done"
22 28 end
23 29
24 30 desc "Clean build artifacts from previous builds"
25 31 task :clean do
26   - sh "rm -rf tmp dist tests/ember-data-tests.js"
27   -end
28   -
29   -desc "Run jshint"
30   -task :jshint do
31   - unless system("which jshint > /dev/null 2>&1")
32   - abort "Please install jshint. `npm install -g jshint`"
33   - end
34   -
35   - if system("jshint packages/ember*")
36   - puts "The JavaScript is clean".green
37   - else
38   - puts "The JavaScript is dirty".red
39   - exit(1)
40   - end
  32 + puts "Cleaning build..."
  33 + pipeline.clean
  34 + puts "Done"
41 35 end
42 36
43   -
44 37 desc "Run tests with phantomjs"
45 38 task :test, [:suite] => :dist do |t, args|
46 39 unless system("which phantomjs > /dev/null 2>&1")
@@ -49,7 +42,11 @@ task :test, [:suite] => :dist do |t, args|
49 42
50 43 suites = {
51 44 :default => ["package=all"],
52   - :all => ["package=all", "package=all&jquery=1.6.4", "package=all&extendprototypes=true", "package=all&extendprototypes=true&jquery=1.6.4"]
  45 + :all => ["package=all",
  46 + "package=all&jquery=1.6.4&nojshint=true",
  47 + "package=all&extendprototypes=true&nojshint=true",
  48 + "package=all&extendprototypes=true&jquery=1.6.4&nojshint=true",
  49 + "package=all&dist=build&nojshint=true"]
53 50 }
54 51
55 52 suite = args[:suite] || :default
13 config.ru
@@ -2,5 +2,18 @@ require 'bundler/setup'
2 2 require 'rake-pipeline'
3 3 require 'rake-pipeline/middleware'
4 4
  5 +class NoCache
  6 + def initialize(app)
  7 + @app = app
  8 + end
  9 +
  10 + def call(env)
  11 + @app.call(env).tap do |status, headers, body|
  12 + headers["Cache-Control"] = "no-store"
  13 + end
  14 + end
  15 +end
  16 +
  17 +use NoCache
5 18 use Rake::Pipeline::Middleware, "Assetfile"
6 19 run Rack::Directory.new('.')
43 packages/ember-data/tests/unit/model_test.js
... ... @@ -1,6 +1,6 @@
1 1 var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
2 2
3   -var store, Person;
  3 +var Person, store, array;
4 4
5 5 module("DS.Model", {
6 6 setup: function() {
@@ -12,8 +12,8 @@ module("DS.Model", {
12 12 },
13 13
14 14 teardown: function() {
15   - store = null;
16 15 Person = null;
  16 + store = null;
17 17 }
18 18 });
19 19
@@ -144,13 +144,33 @@ test("retrieving properties should return the same value as they would if they w
144 144 })
145 145 });
146 146
  147 + // TODO :
  148 + // Investigate why this test fail with DS.attr `name` and jshint because of this :
  149 + // if (typeof String.prototype.name !== 'function') {
  150 + // String.prototype.name = function () {
  151 + // if (ix.test(this)) {
  152 + // return this;
  153 + // }
  154 + // if (nx.test(this)) {
  155 + // return '"' + this.replace(nxg, function (a) {
  156 + // var c = escapes[a];
  157 + // if (c) {
  158 + // return c;
  159 + // }
  160 + // return '\\u' + ('0000' + a.charCodeAt().toString(16)).slice(-4);
  161 + // }) + '"';
  162 + // }
  163 + // return '"' + this + '"';
  164 + // };
  165 + // }
  166 +
147 167 var Person = DS.Model.extend({
148   - name: DS.attr('string')
  168 + firstName: DS.attr('string')
149 169 });
150 170
151 171 var record = store.find(Person, 1);
152 172
153   - strictEqual(get(record, 'name'), null, "returns null value");
  173 + strictEqual(get(record, 'firstName'), null, "returns null value");
154 174 });
155 175
156 176 test("it should cache attributes", function() {
@@ -183,16 +203,17 @@ test("it can specify which key to use when looking up properties on the hash", f
183 203 equal(get(record, 'name'), "Pete", "retrieves correct value");
184 204 });
185 205
186   -
187   -
188   -var Person, store, array;
189   -
190 206 module("DS.Model updating", {
191 207 setup: function() {
192 208 array = [{ id: 1, name: "Scumbag Dale" }, { id: 2, name: "Scumbag Katz" }, { id: 3, name: "Scumbag Bryn" }];
193 209 Person = DS.Model.extend({ name: DS.attr('string') });
194 210 store = DS.Store.create();
195 211 store.loadMany(Person, array);
  212 + },
  213 + teardown: function() {
  214 + Person = null;
  215 + store = null;
  216 + array = null;
196 217 }
197 218 });
198 219
@@ -258,6 +279,7 @@ test("when a DS.Model updates its attributes, its changes affect its filtered Ar
258 279 equal(get(people, 'length'), 0, "there are now no items");
259 280 });
260 281
  282 +
261 283 module("with a simple Person model", {
262 284 setup: function() {
263 285 array = [{ id: 1, name: "Scumbag Dale" }, { id: 2, name: "Scumbag Katz" }, { id: 3, name: "Scumbag Bryn" }];
@@ -266,6 +288,11 @@ module("with a simple Person model", {
266 288 });
267 289 store = DS.Store.create();
268 290 store.loadMany(Person, array);
  291 + },
  292 + teardown: function() {
  293 + Person = null;
  294 + store = null;
  295 + array = null;
269 296 }
270 297 });
271 298
801 packages/ember/lib/main.js
... ... @@ -1,4 +1,4 @@
1   -(function(exports) {
  1 +(function() {
2 2 /*global __fail__*/
3 3 /**
4 4 Define an assertion that will throw an exception if the condition is not
@@ -126,9 +126,9 @@ window.ember_deprecateFunc = function(message, func) {
126 126 };
127 127 };
128 128
129   -})({});
  129 +})();
130 130
131   -(function(exports) {
  131 +(function() {
132 132 // lib/handlebars/base.js
133 133 var Handlebars = {};
134 134
@@ -1199,13 +1199,13 @@ Handlebars.JavaScriptCompiler = function() {};
1199 1199 // PUBLIC API: You can override these methods in a subclass to provide
1200 1200 // alternative compiled forms for name lookup and buffering semantics
1201 1201 nameLookup: function(parent, name, type) {
1202   - if (/^[0-9]+$/.test(name)) {
  1202 + if (/^[0-9]+$/.test(name)) {
1203 1203 return parent + "[" + name + "]";
1204 1204 } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
1205   - return parent + "." + name;
1206   - }
1207   - else {
1208   - return parent + "['" + name + "']";
  1205 + return parent + "." + name;
  1206 + }
  1207 + else {
  1208 + return parent + "['" + name + "']";
1209 1209 }
1210 1210 },
1211 1211
@@ -1419,7 +1419,7 @@ Handlebars.JavaScriptCompiler = function() {};
1419 1419 lookup: function(name) {
1420 1420 var topStack = this.topStack();
1421 1421 this.source.push(topStack + " = (" + topStack + " === null || " + topStack + " === undefined || " + topStack + " === false ? " +
1422   - topStack + " : " + this.nameLookup(topStack, name, 'context') + ");");
  1422 + topStack + " : " + this.nameLookup(topStack, name, 'context') + ");");
1423 1423 },
1424 1424
1425 1425 pushStringParam: function(string) {
@@ -1622,12 +1622,12 @@ Handlebars.JavaScriptCompiler = function() {};
1622 1622 compilerWords[reservedWords[i]] = true;
1623 1623 }
1624 1624
1625   - JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
1626   - if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
1627   - return true;
1628   - }
1629   - return false;
1630   - }
  1625 + JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
  1626 + if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
  1627 + return true;
  1628 + }
  1629 + return false;
  1630 + }
1631 1631
1632 1632 })(Handlebars.Compiler, Handlebars.JavaScriptCompiler);
1633 1633
@@ -1723,9 +1723,9 @@ Handlebars.template = Handlebars.VM.template;
1723 1723 ;
1724 1724
1725 1725
1726   -})({});
  1726 +})();
1727 1727
1728   -(function(exports) {
  1728 +(function() {
1729 1729 // ==========================================================================
1730 1730 // Project: Ember Metal
1731 1731 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -1861,9 +1861,11 @@ if ('undefined' === typeof ember_deprecateFunc) {
1861 1861 */
1862 1862 Ember.Logger = window.console || { log: Ember.K, warn: Ember.K, error: Ember.K };
1863 1863
1864   -})({});
  1864 +})();
1865 1865
1866   -(function(exports) {
  1866 +
  1867 +
  1868 +(function() {
1867 1869 // ==========================================================================
1868 1870 // Project: Ember Metal
1869 1871 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -2015,9 +2017,11 @@ if (!platform.defineProperty) {
2015 2017 platform.defineProperty.isSimulated = true;
2016 2018 }
2017 2019
2018   -})({});
  2020 +})();
  2021 +
2019 2022
2020   -(function(exports) {
  2023 +
  2024 +(function() {
2021 2025 // ==========================================================================
2022 2026 // Project: Ember Metal
2023 2027 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -2318,8 +2322,6 @@ Ember.wrap = function(func, superFunc) {
2318 2322 };
2319 2323
2320 2324 /**
2321   - @function
2322   -
2323 2325 Returns true if the passed object is an array or Array-like.
2324 2326
2325 2327 Ember Array Protocol:
@@ -2331,6 +2333,11 @@ Ember.wrap = function(func, superFunc) {
2331 2333 Unlike Ember.typeOf this method returns true even if the passed object is
2332 2334 not formally array but appears to be array-like (i.e. implements Ember.Array)
2333 2335
  2336 + Ember.isArray(); // false
  2337 + Ember.isArray([]); // true
  2338 + Ember.isArray( Ember.ArrayProxy.create({ content: [] }) ); // true
  2339 +
  2340 + @name Ember.isArray
2334 2341 @param {Object} obj The object to test
2335 2342 @returns {Boolean}
2336 2343 */
@@ -2347,6 +2354,15 @@ Ember.isArray = function(obj) {
2347 2354 an array or array-like, returns the object. Otherwise adds the object to
2348 2355 an array. If obj is null or undefined, returns an empty array.
2349 2356
  2357 + Ember.makeArray(); => []
  2358 + Ember.makeArray(null); => []
  2359 + Ember.makeArray(undefined); => []
  2360 + Ember.makeArray('lindsay'); => ['lindsay']
  2361 + Ember.makeArray([1,2,42]); => [1,2,42]
  2362 +
  2363 + var controller = Ember.ArrayProxy.create({ content: [] });
  2364 + Ember.makeArray(controller) === controller; => true
  2365 +
2350 2366 @param {Object} obj the object
2351 2367 @returns {Array}
2352 2368 */
@@ -2357,9 +2373,11 @@ Ember.makeArray = function(obj) {
2357 2373
2358 2374
2359 2375
2360   -})({});
  2376 +})();
  2377 +
2361 2378
2362   -(function(exports) {
  2379 +
  2380 +(function() {
2363 2381 // ==========================================================================
2364 2382 // Project: Ember Metal
2365 2383 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -2746,9 +2764,11 @@ Ember.isGlobalPath = function(path) {
2746 2764 return !HAS_THIS.test(path) && IS_GLOBAL.test(path);
2747 2765 };
2748 2766
2749   -})({});
  2767 +})();
2750 2768
2751   -(function(exports) {
  2769 +
  2770 +
  2771 +(function() {
2752 2772 // ==========================================================================
2753 2773 // Project: Ember Metal
2754 2774 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -3157,9 +3177,11 @@ Ember.createPrototype = function(obj, props) {
3157 3177 return ret;
3158 3178 };
3159 3179
3160   -})({});
  3180 +})();
3161 3181
3162   -(function(exports) {
  3182 +
  3183 +
  3184 +(function() {
3163 3185 // ==========================================================================
3164 3186 // Project: Ember Metal
3165 3187 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -3518,9 +3540,11 @@ Ember.cacheFor = function(obj, key) {
3518 3540 }
3519 3541 };
3520 3542
3521   -})({});
  3543 +})();
  3544 +
3522 3545
3523   -(function(exports) {
  3546 +
  3547 +(function() {
3524 3548 /*jshint newcap:false*/
3525 3549
3526 3550 // NOTE: There is a bug in jshint that doesn't recognize `Object()` without `new`
@@ -3611,6 +3635,13 @@ Ember.ArrayUtils = {
3611 3635 return obj.indexOf ? obj.indexOf.apply(obj, args) : arrayIndexOf.apply(obj, args);
3612 3636 },
3613 3637
  3638 + indexesOf: function(obj) {
  3639 + var args = Array.prototype.slice.call(arguments, 1);
  3640 + return args[0] === undefined ? [] : Ember.ArrayUtils.map(args[0], function(item) {
  3641 + return Ember.ArrayUtils.indexOf(obj, item);
  3642 + });
  3643 + },
  3644 +
3614 3645 removeObject: function(array, item) {
3615 3646 var index = this.indexOf(array, item);
3616 3647 if (index !== -1) { array.splice(index, 1); }
@@ -3635,9 +3666,11 @@ if (Ember.SHIM_ES5) {
3635 3666 }
3636 3667 }
3637 3668
3638   -})({});
  3669 +})();
  3670 +
  3671 +
3639 3672
3640   -(function(exports) {
  3673 +(function() {
3641 3674 // ==========================================================================
3642 3675 // Project: Ember Metal
3643 3676 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -3889,9 +3922,11 @@ Ember.notifyBeforeObservers = function(obj, keyName) {
3889 3922 };
3890 3923
3891 3924
3892   -})({});
  3925 +})();
  3926 +
3893 3927
3894   -(function(exports) {
  3928 +
  3929 +(function() {
3895 3930 // ==========================================================================
3896 3931 // Project: Ember Metal
3897 3932 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -4501,9 +4536,11 @@ Ember.destroy = function (obj) {
4501 4536 }
4502 4537 };
4503 4538
4504   -})({});
  4539 +})();
  4540 +
  4541 +
4505 4542
4506   -(function(exports) {
  4543 +(function() {
4507 4544 // ==========================================================================
4508 4545 // Project: Ember Metal
4509 4546 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -4765,9 +4802,11 @@ Ember.hasListeners = hasListeners;
4765 4802 Ember.watchedEvents = watchedEvents;
4766 4803 Ember.listenersFor = listenersFor;
4767 4804 Ember.deferEvent = deferEvent;
4768   -})({});
  4805 +})();
  4806 +
4769 4807
4770   -(function(exports) {
  4808 +
  4809 +(function() {
4771 4810 // ==========================================================================
4772 4811 // Project: Ember Runtime
4773 4812 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -5324,9 +5363,11 @@ Ember.beforeObserver = function(func) {
5324 5363
5325 5364
5326 5365
5327   -})({});
  5366 +})();
  5367 +
  5368 +
5328 5369
5329   -(function(exports) {
  5370 +(function() {
5330 5371 // ==========================================================================
5331 5372 // Project: Ember Runtime
5332 5373 // Copyright: ©2006-2011 Strobe Inc. and contributors.
@@ -5885,9 +5926,11 @@ Ember.RunLoop.end = ember_deprecateFunc("Use Ember.run.end instead of Ember.RunL
5885 5926
5886 5927
5887 5928
5888   -})({});
  5929 +})();
  5930 +
  5931 +
5889 5932
5890   -(function(exports) {
  5933 +(function() {
5891 5934 // ==========================================================================
5892 5935 // Project: Ember Runtime
5893 5936 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -6489,9 +6532,9 @@ mixinProperties(Binding,
6489 6532 /**
6490 6533 @see Ember.Binding.prototype.single
6491 6534 */
6492   - single: function(from) {
  6535 + single: function(from, placeholder) {
6493 6536 var C = this, binding = new C(null, from);
6494   - return binding.single();
  6537 + return binding.single(placeholder);
6495 6538 },
6496 6539
6497 6540 /**
@@ -6505,8 +6548,12 @@ mixinProperties(Binding,
6505 6548 /**
6506 6549 @see Ember.Binding.prototype.transform
6507 6550 */
6508   - transform: function(func) {
6509   - var C = this, binding = new C();
  6551 + transform: function(from, func) {
  6552 + if (!func) {
  6553 + func = from;
  6554 + from = null;
  6555 + }
  6556 + var C = this, binding = new C(null, from);
6510 6557 return binding.transform(func);
6511 6558 },
6512 6559
@@ -6519,6 +6566,15 @@ mixinProperties(Binding,
6519 6566 },
6520 6567
6521 6568 /**
  6569 + @see Ember.Binding.prototype.notNull
  6570 + */
  6571 + notNull: function(from, placeholder) {
  6572 + var C = this, binding = new C(null, from);
  6573 + return binding.notNull(placeholder);
  6574 + },
  6575 +
  6576 +
  6577 + /**
6522 6578 @see Ember.Binding.prototype.bool
6523 6579 */
6524 6580 bool: function(from) {
@@ -6535,6 +6591,14 @@ mixinProperties(Binding,
6535 6591 },
6536 6592
6537 6593 /**
  6594 + @see Ember.Binding.prototype.isNull
  6595 + */
  6596 + isNull: function(from) {
  6597 + var C = this, binding = new C(null, from);
  6598 + return binding.isNull();
  6599 + },
  6600 +
  6601 + /**
6538 6602 Adds a transform that forwards the logical 'AND' of values at 'pathA' and
6539 6603 'pathB' whenever either source changes. Note that the transform acts
6540 6604 strictly as a one-way binding, working only in the direction
@@ -6775,18 +6839,20 @@ Ember.oneWay = function(obj, to, from) {
6775 6839 return new Ember.Binding(to, from).oneWay().connect(obj);
6776 6840 };
6777 6841
6778   -})({});
  6842 +})();
  6843 +
6779 6844
6780   -(function(exports) {
  6845 +
  6846 +(function() {
6781 6847 // ==========================================================================
6782 6848 // Project: Ember Metal
6783 6849 // Copyright: ©2011 Strobe Inc. and contributors.
6784 6850 // License: Licensed under MIT license (see license.js)
6785 6851 // ==========================================================================
6786 6852
6787   -})({});
  6853 +})();
6788 6854
6789   -(function(exports) {
  6855 +(function() {
6790 6856 /**
6791 6857 * @license
6792 6858 * ==========================================================================
@@ -6817,9 +6883,11 @@ Ember.oneWay = function(obj, to, from) {
6817 6883 * ==========================================================================
6818 6884 */
6819 6885
6820   -})({});
  6886 +})();
  6887 +
  6888 +
6821 6889
6822   -(function(exports) {
  6890 +(function() {
6823 6891 // ==========================================================================
6824 6892 // Project: Ember Runtime
6825 6893 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -6846,7 +6914,7 @@ if (typeof console === 'undefined') {
6846 6914 var TYPE_MAP = {};
6847 6915 var t ="Boolean Number String Function Array Date RegExp Object".split(" ");
6848 6916 Ember.ArrayUtils.forEach(t, function(name) {
6849   - TYPE_MAP[ "[object " + name + "]" ] = name.toLowerCase();
  6917 + TYPE_MAP[ "[object " + name + "]" ] = name.toLowerCase();
6850 6918 });
6851 6919
6852 6920 var toString = Object.prototype.toString;
@@ -6858,18 +6926,36 @@ var toString = Object.prototype.toString;
6858 6926 It will return the same result across all browsers and includes a bit
6859 6927 more detail. Here is what will be returned:
6860 6928
6861   - | Return Value Constant | Meaning |
6862   - | 'string' | String primitive |
6863   - | 'number' | Number primitive |
6864   - | 'boolean' | Boolean primitive |
6865   - | 'null' | Null value |
6866   - | 'undefined' | Undefined value |
6867   - | 'function' | A function |
6868   - | 'array' | An instance of Array |
6869   - | 'class' | A Ember class (created using Ember.Object.extend()) |
6870   - | 'instance' | A Ember object instance |
6871   - | 'error' | An instance of the Error object |
6872   - | 'object' | A JavaScript object not inheriting from Ember.Object |
  6929 + | Return Value | Meaning |
  6930 + |---------------|------------------------------------------------------|
  6931 + | 'string' | String primitive |
  6932 + | 'number' | Number primitive |
  6933 + | 'boolean' | Boolean primitive |
  6934 + | 'null' | Null value |
  6935 + | 'undefined' | Undefined value |
  6936 + | 'function' | A function |
  6937 + | 'array' | An instance of Array |
  6938 + | 'class' | A Ember class (created using Ember.Object.extend()) |
  6939 + | 'instance' | A Ember object instance |
  6940 + | 'error' | An instance of the Error object |
  6941 + | 'object' | A JavaScript object not inheriting from Ember.Object |
  6942 +
  6943 + Examples:
  6944 +
  6945 + Ember.typeOf(); => 'undefined'
  6946 + Ember.typeOf(null); => 'null'
  6947 + Ember.typeOf(undefined); => 'undefined'
  6948 + Ember.typeOf('michael'); => 'string'
  6949 + Ember.typeOf(101); => 'number'
  6950 + Ember.typeOf(true); => 'boolean'
  6951 + Ember.typeOf(Ember.makeArray); => 'function'
  6952 + Ember.typeOf([1,2,90]); => 'array'
  6953 + Ember.typeOf(Ember.Object.extend()); => 'class'
  6954 + Ember.typeOf(Ember.Object.create()); => 'instance'
  6955 + Ember.typeOf(new Error('teamocil')); => 'error'
  6956 +
  6957 + // "normal" JavaScript object
  6958 + Ember.typeOf({a: 'b'}); => 'object'
6873 6959
6874 6960 @param item {Object} the item to check
6875 6961 @returns {String} the type
@@ -6895,6 +6981,13 @@ Ember.typeOf = function(item) {
6895 6981 from JSLint complaining about use of ==, which can be technically
6896 6982 confusing.
6897 6983
  6984 + Ember.none(); => true
  6985 + Ember.none(null); => true
  6986 + Ember.none(undefined); => true
  6987 + Ember.none(''); => false
  6988 + Ember.none([]); => false
  6989 + Ember.none(function(){}); => false
  6990 +
6898 6991 @param {Object} obj Value to test
6899 6992 @returns {Boolean}
6900 6993 */
@@ -6905,6 +6998,17 @@ Ember.none = function(obj) {
6905 6998 /**
6906 6999 Verifies that a value is null or an empty string | array | function.
6907 7000
  7001 + Constrains the rules on `Ember.none` by returning false for empty
  7002 + string and empty arrays.
  7003 +
  7004 + Ember.empty(); => true
  7005 + Ember.empty(null); => true
  7006 + Ember.empty(undefined); => true
  7007 + Ember.empty(''); => true
  7008 + Ember.empty([]); => true
  7009 + Ember.empty('tobias fünke'); => false
  7010 + Ember.empty([0,1,2]); => false
  7011 +
6908 7012 @param {Object} obj Value to test
6909 7013 @returns {Boolean}
6910 7014 */
@@ -6913,10 +7017,6 @@ Ember.empty = function(obj) {
6913 7017 };
6914 7018
6915 7019 /**
6916   - Ember.isArray defined in ember-metal/lib/utils
6917   -**/
6918   -
6919   -/**
6920 7020 This will compare two javascript values of possibly different types.
6921 7021 It will tell you which one is greater than the other by returning:
6922 7022
@@ -6927,6 +7027,10 @@ Ember.empty = function(obj) {
6927 7027 The order is calculated based on Ember.ORDER_DEFINITION, if types are different.
6928 7028 In case they have the same type an appropriate comparison for this type is made.
6929 7029
  7030 + Ember.compare('hello', 'hello'); => 0
  7031 + Ember.compare('abc', 'dfg'); => -1
  7032 + Ember.compare(2, 1); => 1
  7033 +
6930 7034 @param {Object} v First value to compare
6931 7035 @param {Object} w Second value to compare
6932 7036 @returns {Number} -1 if v < w, 0 if v = w and 1 if v > w.
@@ -7096,6 +7200,10 @@ Ember.inspect = function(obj) {
7096 7200 internal objects. For any other object that implements `isEqual()` it will
7097 7201 respect that method.
7098 7202
  7203 + Ember.isEqual('hello', 'hello'); => true
  7204 + Ember.isEqual(1, 2); => false
  7205 + Ember.isEqual([4,2], [4,2]); => false
  7206 +
7099 7207 @param {Object} a first object to compare
7100 7208 @param {Object} b second object to compare
7101 7209 @returns {Boolean}
@@ -7163,9 +7271,11 @@ Ember.Error = function() {
7163 7271
7164 7272 Ember.Error.prototype = Ember.create(Error.prototype);
7165 7273
7166   -})({});
  7274 +})();
  7275 +
  7276 +
7167 7277
7168   -(function(exports) {
  7278 +(function() {
7169 7279 // ==========================================================================
7170 7280 // Project: Ember Runtime
7171 7281 // Copyright: ©2011 Strobe Inc.
@@ -7358,9 +7468,11 @@ Ember.String = {
7358 7468 replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase();
7359 7469 }
7360 7470 };
7361   -})({});
  7471 +})();
  7472 +
7362 7473
7363   -(function(exports) {
  7474 +
  7475 +(function() {
7364 7476 // ==========================================================================
7365 7477 // Project: Ember Runtime
7366 7478 // Copyright: ©2006-2011 Strobe Inc. and contributors.
@@ -7429,9 +7541,11 @@ if (Ember.EXTEND_PROTOTYPES) {
7429 7541 }
7430 7542
7431 7543
7432   -})({});
  7544 +})();
  7545 +
  7546 +
7433 7547
7434   -(function(exports) {
  7548 +(function() {
7435 7549 // ==========================================================================
7436 7550 // Project: Ember Runtime
7437 7551 // Copyright: ©2006-2011 Strobe Inc. and contributors.
@@ -7539,9 +7653,11 @@ if (Ember.EXTEND_PROTOTYPES) {
7539 7653 }
7540 7654
7541 7655
7542   -})({});
  7656 +})();
  7657 +
7543 7658
7544   -(function(exports) {
  7659 +
  7660 +(function() {
7545 7661 // ==========================================================================
7546 7662 // Project: Ember Runtime
7547 7663 // Copyright: ©2006-2011 Strobe Inc. and contributors.
@@ -7575,18 +7691,22 @@ Ember._mixinBindings = function(obj, key, value, m) {
7575 7691 return value;
7576 7692 };
7577 7693
7578   -})({});
  7694 +})();
  7695 +
  7696 +
7579 7697
7580   -(function(exports) {
  7698 +(function() {
7581 7699 // ==========================================================================
7582 7700 // Project: Ember Runtime
7583 7701 // Copyright: ©2011 Strobe Inc. and contributors.
7584 7702 // License: Licensed under MIT license (see license.js)
7585 7703 // ==========================================================================
7586 7704
7587   -})({});
  7705 +})();
  7706 +
  7707 +
7588 7708
7589   -(function(exports) {
  7709 +(function() {
7590 7710 // ==========================================================================
7591 7711 // Project: Ember Runtime
7592 7712 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -8355,9 +8475,11 @@ Ember.Enumerable = Ember.Mixin.create( /** @lends Ember.Enumerable */ {
8355 8475
8356 8476
8357 8477
8358   -})({});
  8478 +})();
  8479 +
  8480 +
8359 8481
8360   -(function(exports) {
  8482 +(function() {
8361 8483 // ==========================================================================
8362 8484 // Project: Ember Runtime
8363 8485 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -8367,7 +8489,7 @@ Ember.Enumerable = Ember.Mixin.create( /** @lends Ember.Enumerable */ {
8367 8489 // HELPERS
8368 8490 //
8369 8491
8370   -var get = Ember.get, set = Ember.set, meta = Ember.meta;
  8492 +var get = Ember.get, set = Ember.set, meta = Ember.meta, map = Ember.ArrayUtils.map;
8371 8493
8372 8494 /** @private */
8373 8495 function none(obj) { return obj===null || obj===undefined; }
@@ -8440,6 +8562,17 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
8440 8562 return get(this, idx);
8441 8563 },
8442 8564
  8565 + /**
  8566 + This returns the objects at the specified indexes, using objectAt.
  8567 +
  8568 + @param {Array} indexes
  8569 + An array of indexes of items to return.
  8570 + */
  8571 + objectsAt: function(indexes) {
  8572 + var self = this;
  8573 + return map(indexes, function(value,idx){ return self.objectAt(idx); });
  8574 + },
  8575 +
8443 8576 /** @private (nodoc) - overrides Ember.Enumerable version */
8444 8577 nextObject: function(idx) {
8445 8578 return this.objectAt(idx);
@@ -8720,9 +8853,11 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
8720 8853
8721 8854
8722 8855
8723   -})({});
  8856 +})();
  8857 +
  8858 +
8724 8859
8725   -(function(exports) {
  8860 +(function() {
8726 8861 // ==========================================================================
8727 8862 // Project: Ember Runtime
8728 8863 // Copyright: ©2006-2011 Strobe Inc. and contributors.
@@ -8769,9 +8904,11 @@ Ember.Comparable = Ember.Mixin.create( /** @scope Ember.Comparable.prototype */{
8769 8904 });
8770 8905
8771 8906
8772   -})({});
  8907 +})();
  8908 +
8773 8909
8774   -(function(exports) {
  8910 +
  8911 +(function() {
8775 8912 // ==========================================================================
8776 8913 // Project: Ember Runtime
8777 8914 // Copyright: ©2006-2011 Strobe Inc. and contributors.
@@ -8831,9 +8968,11 @@ Ember.Copyable = Ember.Mixin.create(
8831 8968
8832 8969
8833 8970
8834   -})({});
  8971 +})();
  8972 +
8835 8973
8836   -(function(exports) {
  8974 +
  8975 +(function() {
8837 8976 // ==========================================================================
8838 8977 // Project: Ember Runtime
8839 8978 // Copyright: ©2006-2011 Strobe Inc. and contributors.
@@ -8933,9 +9072,11 @@ Ember.FROZEN_ERROR = "Frozen object cannot be modified.";
8933 9072
8934 9073
8935 9074
8936   -})({});
  9075 +})();
  9076 +
  9077 +
8937 9078
8938   -(function(exports) {
  9079 +(function() {
8939 9080 // ==========================================================================
8940 9081 // Project: Ember Runtime
8941 9082 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -9047,9 +9188,11 @@ Ember.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable,
9047 9188
9048 9189 });
9049 9190
9050   -})({});
  9191 +})();
9051 9192
9052   -(function(exports) {
  9193 +
  9194 +
  9195 +(function() {
9053 9196 // ==========================================================================
9054 9197 // Project: Ember Runtime
9055 9198 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -9294,9 +9437,11 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
9294 9437 });
9295 9438
9296 9439
9297   -})({});
  9440 +})();
  9441 +
9298 9442
9299   -(function(exports) {
  9443 +
  9444 +(function() {
9300 9445 // ==========================================================================
9301 9446 // Project: Ember Runtime
9302 9447 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -9789,9 +9934,11 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
9789 9934
9790 9935
9791 9936
9792   -})({});
  9937 +})();
  9938 +
  9939 +
9793 9940
9794   -(function(exports) {
  9941 +(function() {
9795 9942 var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
9796 9943
9797 9944 Ember.TargetActionSupport = Ember.Mixin.create({
@@ -9835,9 +9982,11 @@ Ember.TargetActionSupport = Ember.Mixin.create({
9835 9982 }
9836 9983 });
9837 9984
9838   -})({});
  9985 +})();
  9986 +
9839 9987
9840   -(function(exports) {
  9988 +
  9989 +(function() {
9841 9990 var get = Ember.get, set = Ember.set, a_slice = Array.prototype.slice;
9842 9991
9843 9992 /** @private */
@@ -9865,18 +10014,22 @@ Ember.Evented = Ember.Mixin.create({
9865 10014 }
9866 10015 });
9867 10016
9868   -})({});
  10017 +})();
  10018 +
  10019 +
9869 10020
9870   -(function(exports) {
  10021 +(function() {
9871 10022 // ==========================================================================
9872 10023 // Project: Ember Runtime
9873 10024 // Copyright: ©2011 Strobe Inc. and contributors.
9874 10025 // License: Licensed under MIT license (see license.js)
9875 10026 // ==========================================================================
9876 10027
9877   -})({});
  10028 +})();
9878 10029
9879   -(function(exports) {
  10030 +
  10031 +
  10032 +(function() {
9880 10033 // ==========================================================================
9881 10034 // Project: Ember Runtime
9882 10035 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -10184,9 +10337,11 @@ Ember.CoreObject = CoreObject;
10184 10337
10185 10338
10186 10339
10187   -})({});
  10340 +})();
  10341 +
10188 10342
10189   -(function(exports) {
  10343 +
  10344 +(function() {
10190 10345 // ==========================================================================
10191 10346 // Project: Ember Runtime
10192 10347 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -10629,9 +10784,11 @@ Ember.Set.create = function(items) {
10629 10784 }
10630 10785 };
10631 10786
10632   -})({});
  10787 +})();
  10788 +
  10789 +
10633 10790
10634   -(function(exports) {
  10791 +(function() {
10635 10792 // ==========================================================================
10636 10793 // Project: Ember Runtime
10637 10794 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -10649,9 +10806,11 @@ Ember.Object = Ember.CoreObject.extend(Ember.Observable);
10649 10806
10650 10807
10651 10808
10652   -})({});
  10809 +})();
  10810 +
  10811 +
10653 10812
10654   -(function(exports) {
  10813 +(function() {
10655 10814 // ==========================================================================
10656 10815 // Project: Ember Runtime
10657 10816 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -10696,9 +10855,11 @@ Ember.Namespace = Ember.Object.extend({
10696 10855 Ember.Namespace.NAMESPACES = [Ember];
10697 10856 Ember.Namespace.PROCESSED = false;
10698 10857
10699   -})({});
  10858 +})();
  10859 +
10700 10860
10701   -(function(exports) {
  10861 +
  10862 +(function() {
10702 10863 // ==========================================================================
10703 10864 // Project: Ember Runtime
10704 10865 // Copyright: ©2011 Strobe Inc. and contributors.
@@ -10730,9 +10891,11 @@ Ember.Namespace.PROCESSED = false;
10730 10891 Ember.Application = Ember.Namespace.extend();
10731 10892
10732 10893
10733   -})({});
  10894 +})();
  10895 +
10734 10896
10735   -(function(exports) {
  10897 +