1
SampleWidgetType.prototype = {
3
create: function(callback)
11
// A comment here to explain the return is okay.
16
// Cant return value even after calling callback.
22
// Need to pass self or this to callback function.
29
this.createChildren(null, function() {
30
callback.call(self, div);
33
// Never good to return a vaue.
41
AnotherSampleWidgetType.prototype = {
43
create: function(input)
48
getSomething: function(input)
56
NoCreateWidgetType.prototype = {
58
getSomething: function(input)
66
SomeRandom.prototype = {
68
create: function(input)
75
SampleWidgetType.prototype = {
77
create: function(callback)
80
// This is ok because it is the last statement,
81
// even though it is conditional.
89
SampleWidgetType.prototype = {
91
create: function(callback)
93
var something = callback;
99
SampleWidgetType.prototype = {
101
create: function(callback)
103
// Also valid because we are passing the callback to
104
// someone else to call.
106
this.something(callback);
116
SampleWidgetType.prototype = {
118
create: function(callback)
120
// Also valid because we are passing the callback to
121
// someone else to call.
123
this.something(callback);
132
SampleWidgetType.prototype = {
134
create: function(callback)
137
// This is ok because it is the last statement,
138
// even though it is conditional.
139
this.something(callback);
147
SampleWidgetType.prototype = {
149
create: function(callback)
151
if (dfx.isFn(callback) === true) {
152
callback.call(this, cont);
160
SampleWidgetType.prototype = {
162
create: function(callback)
164
dfx.foreach(items, function(item) {
168
if (dfx.isFn(callback) === true) {
175
SampleWidgetType.prototype = {
177
create: function(callback)
180
this.createChildren(null, function() {
181
callback.call(self, div);
b'\\ No newline at end of file'