-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathruntime.output.js
More file actions
96 lines (77 loc) · 1.91 KB
/
runtime.output.js
File metadata and controls
96 lines (77 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import classic from 'ember-classic-decorator';
import { off, unobserves, observes } from '@ember-decorators/object';
import { action, computed } from '@ember/object';
import { service } from '@ember/service';
import { alias } from '@ember/object/computed';
import Runtime from 'common/runtime';
import { customMacro, customMacroWithInput } from 'my-app/lib';
/**
* Program comments
*/
@classic
export default class _Runtime extends Runtime.extend(MyMixin) {
/**
* Property comments
*/
prop = 'defaultValue';
boolProp = true;
numProp = 123;
[MY_VAL] = 'val';
queryParams = {};
@service
error;
@service('error')
errorService;
@observes('prop')
observerProp() { return this.prop; }
@unobserves('prop3', 'prop4')
unobservedProp;
@off('prop1', 'prop2')
offProp;
@computed('numProp')
get numPlusOne() {
return this.get('numProp') + 1;
}
@alias('numPlusOne')
numPlusPlus;
@customMacro()
computedMacro;
@customMacroWithInput({
foo: 123,
bar: 'baz'
})
anotherMacro;
/**
* Method comments
*/
method() {
// do things
}
otherMethod() {}
get accessor() {
return this._value;
}
set accessor(value) {
this._value = value;
}
anotherMethod() {
undefined;
}
overriddenMethod() {
super.overriddenMethod(...arguments);
}
@action
actionMethod() {
undefined && this.boolProp;
}
@action
overriddenActionMethod() {
// TODO: This call to super is within an action, and has to refer to the parent
// class's actions to be safe. This should be refactored to call a normal method
// on the parent class. If the parent class has not been converted to native
// classes, it may need to be refactored as well. See
// https://github.com/ember-codemods/ember-native-class-codemod/blob/master/README.md
// for more details.
super.actions.overriddenActionMethod.call(this, ...arguments) && this.boolProp;
}
}