forked from emberjs/ember-cli-babel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve acceptance tests and Ember syntax
- Loading branch information
Showing
6 changed files
with
41 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Controller.extend({ | ||
const { Controller, A, computed } = Ember; | ||
|
||
export default Controller.extend({ | ||
|
||
// Just a very roundabout way of using some ES6 features | ||
value: ((test = 'Test') => `${test} ${'Value'}`)(), // jshint ignore:line | ||
|
||
// Test a generator (needs the regenerator runtime) and some ES6 constructs (requires the corejs polyfill) | ||
values: Ember.A(Array.from({ *[Symbol.iterator]() { yield 'one'; yield 'two'; } })) // jshint ignore:line | ||
values: A(Array.from({ *[Symbol.iterator]() { yield 'one'; yield 'two'; } })), // jshint ignore:line | ||
|
||
hasProxies: computed({ | ||
get() { | ||
const target = {}; | ||
const handler = { | ||
get: (receiver, name) => { | ||
return `Hello, ${name}!`; | ||
} | ||
}; | ||
|
||
const p = new Proxy(target, handler); | ||
return p.world === 'Hello, world!'; | ||
} | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import Ember from 'ember'; | ||
import config from './config/environment'; | ||
|
||
const Router = Ember.Router.extend({ | ||
const { Router } = Ember; | ||
|
||
const EmRouter = Router.extend({ | ||
location: config.locationType, | ||
rootURL: config.rootURL | ||
}); | ||
|
||
Router.map(function() { | ||
EmRouter.map(() => { | ||
}); | ||
|
||
export default Router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import Ember from 'ember'; | ||
|
||
const { run } = Ember; | ||
|
||
export default function destroyApp(application) { | ||
Ember.run(application, 'destroy'); | ||
run(application, 'destroy'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters