Skip to content

Commit 0b71a93

Browse files
committed
update tests
1 parent ef3cf34 commit 0b71a93

File tree

20 files changed

+120
-140
lines changed

20 files changed

+120
-140
lines changed

test/js/samples/collapses-text-around-comments/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ function setAttribute(node, attribute, value) {
3737
node.setAttribute(attribute, value);
3838
}
3939

40+
function blankObject() {
41+
return Object.create(null);
42+
}
43+
4044
function destroy(detach) {
4145
this.destroy = noop;
4246
this.fire('destroy');
@@ -89,13 +93,8 @@ function get(key) {
8993
function init(component, options) {
9094
component.options = options;
9195

92-
component._observers = {
93-
pre: Object.create(null),
94-
post: Object.create(null)
95-
};
96-
97-
component._handlers = Object.create(null);
98-
96+
component._observers = { pre: blankObject(), post: blankObject() };
97+
component._handlers = blankObject();
9998
component._root = options._root || component;
10099
component._yield = options._yield;
101100
component._bind = options._bind;

test/js/samples/computed-collapsed-if/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ function assign(target) {
1313
return target;
1414
}
1515

16+
function blankObject() {
17+
return Object.create(null);
18+
}
19+
1620
function destroy(detach) {
1721
this.destroy = noop;
1822
this.fire('destroy');
@@ -65,13 +69,8 @@ function get(key) {
6569
function init(component, options) {
6670
component.options = options;
6771

68-
component._observers = {
69-
pre: Object.create(null),
70-
post: Object.create(null)
71-
};
72-
73-
component._handlers = Object.create(null);
74-
72+
component._observers = { pre: blankObject(), post: blankObject() };
73+
component._handlers = blankObject();
7574
component._root = options._root || component;
7675
component._yield = options._yield;
7776
component._bind = options._bind;

test/js/samples/css-media-query/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ function setAttribute(node, attribute, value) {
3333
node.setAttribute(attribute, value);
3434
}
3535

36+
function blankObject() {
37+
return Object.create(null);
38+
}
39+
3640
function destroy(detach) {
3741
this.destroy = noop;
3842
this.fire('destroy');
@@ -85,13 +89,8 @@ function get(key) {
8589
function init(component, options) {
8690
component.options = options;
8791

88-
component._observers = {
89-
pre: Object.create(null),
90-
post: Object.create(null)
91-
};
92-
93-
component._handlers = Object.create(null);
94-
92+
component._observers = { pre: blankObject(), post: blankObject() };
93+
component._handlers = blankObject();
9594
component._root = options._root || component;
9695
component._yield = options._yield;
9796
component._bind = options._bind;

test/js/samples/css-shadow-dom-keyframes/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ function createText(data) {
3333
return document.createTextNode(data);
3434
}
3535

36+
function blankObject() {
37+
return Object.create(null);
38+
}
39+
3640
function destroy(detach) {
3741
this.destroy = noop;
3842
this.fire('destroy');
@@ -85,13 +89,8 @@ function get(key) {
8589
function init(component, options) {
8690
component.options = options;
8791

88-
component._observers = {
89-
pre: Object.create(null),
90-
post: Object.create(null)
91-
};
92-
93-
component._handlers = Object.create(null);
94-
92+
component._observers = { pre: blankObject(), post: blankObject() };
93+
component._handlers = blankObject();
9594
component._root = options._root || component;
9695
component._yield = options._yield;
9796
component._bind = options._bind;

test/js/samples/each-block-changed-check/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ function createText(data) {
4646
return document.createTextNode(data);
4747
}
4848

49+
function blankObject() {
50+
return Object.create(null);
51+
}
52+
4953
function destroy(detach) {
5054
this.destroy = noop;
5155
this.fire('destroy');
@@ -98,13 +102,8 @@ function get(key) {
98102
function init(component, options) {
99103
component.options = options;
100104

101-
component._observers = {
102-
pre: Object.create(null),
103-
post: Object.create(null)
104-
};
105-
106-
component._handlers = Object.create(null);
107-
105+
component._observers = { pre: blankObject(), post: blankObject() };
106+
component._handlers = blankObject();
108107
component._root = options._root || component;
109108
component._yield = options._yield;
110109
component._bind = options._bind;

test/js/samples/event-handlers-custom/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ function createText(data) {
3333
return document.createTextNode(data);
3434
}
3535

36+
function blankObject() {
37+
return Object.create(null);
38+
}
39+
3640
function destroy(detach) {
3741
this.destroy = noop;
3842
this.fire('destroy');
@@ -85,13 +89,8 @@ function get(key) {
8589
function init(component, options) {
8690
component.options = options;
8791

88-
component._observers = {
89-
pre: Object.create(null),
90-
post: Object.create(null)
91-
};
92-
93-
component._handlers = Object.create(null);
94-
92+
component._observers = { pre: blankObject(), post: blankObject() };
93+
component._handlers = blankObject();
9594
component._root = options._root || component;
9695
component._yield = options._yield;
9796
component._bind = options._bind;

test/js/samples/if-block-no-update/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ function createComment() {
3737
return document.createComment('');
3838
}
3939

40+
function blankObject() {
41+
return Object.create(null);
42+
}
43+
4044
function destroy(detach) {
4145
this.destroy = noop;
4246
this.fire('destroy');
@@ -89,13 +93,8 @@ function get(key) {
8993
function init(component, options) {
9094
component.options = options;
9195

92-
component._observers = {
93-
pre: Object.create(null),
94-
post: Object.create(null)
95-
};
96-
97-
component._handlers = Object.create(null);
98-
96+
component._observers = { pre: blankObject(), post: blankObject() };
97+
component._handlers = blankObject();
9998
component._root = options._root || component;
10099
component._yield = options._yield;
101100
component._bind = options._bind;

test/js/samples/if-block-simple/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ function createComment() {
3737
return document.createComment('');
3838
}
3939

40+
function blankObject() {
41+
return Object.create(null);
42+
}
43+
4044
function destroy(detach) {
4145
this.destroy = noop;
4246
this.fire('destroy');
@@ -89,13 +93,8 @@ function get(key) {
8993
function init(component, options) {
9094
component.options = options;
9195

92-
component._observers = {
93-
pre: Object.create(null),
94-
post: Object.create(null)
95-
};
96-
97-
component._handlers = Object.create(null);
98-
96+
component._observers = { pre: blankObject(), post: blankObject() };
97+
component._handlers = blankObject();
9998
component._root = options._root || component;
10099
component._yield = options._yield;
101100
component._bind = options._bind;

test/js/samples/inline-style-optimized-multiple/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ function setStyle(node, key, value) {
2929
node.style.setProperty(key, value);
3030
}
3131

32+
function blankObject() {
33+
return Object.create(null);
34+
}
35+
3236
function destroy(detach) {
3337
this.destroy = noop;
3438
this.fire('destroy');
@@ -81,13 +85,8 @@ function get(key) {
8185
function init(component, options) {
8286
component.options = options;
8387

84-
component._observers = {
85-
pre: Object.create(null),
86-
post: Object.create(null)
87-
};
88-
89-
component._handlers = Object.create(null);
90-
88+
component._observers = { pre: blankObject(), post: blankObject() };
89+
component._handlers = blankObject();
9190
component._root = options._root || component;
9291
component._yield = options._yield;
9392
component._bind = options._bind;

test/js/samples/inline-style-optimized-url/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ function setStyle(node, key, value) {
2929
node.style.setProperty(key, value);
3030
}
3131

32+
function blankObject() {
33+
return Object.create(null);
34+
}
35+
3236
function destroy(detach) {
3337
this.destroy = noop;
3438
this.fire('destroy');
@@ -81,13 +85,8 @@ function get(key) {
8185
function init(component, options) {
8286
component.options = options;
8387

84-
component._observers = {
85-
pre: Object.create(null),
86-
post: Object.create(null)
87-
};
88-
89-
component._handlers = Object.create(null);
90-
88+
component._observers = { pre: blankObject(), post: blankObject() };
89+
component._handlers = blankObject();
9190
component._root = options._root || component;
9291
component._yield = options._yield;
9392
component._bind = options._bind;

test/js/samples/inline-style-optimized/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ function setStyle(node, key, value) {
2929
node.style.setProperty(key, value);
3030
}
3131

32+
function blankObject() {
33+
return Object.create(null);
34+
}
35+
3236
function destroy(detach) {
3337
this.destroy = noop;
3438
this.fire('destroy');
@@ -81,13 +85,8 @@ function get(key) {
8185
function init(component, options) {
8286
component.options = options;
8387

84-
component._observers = {
85-
pre: Object.create(null),
86-
post: Object.create(null)
87-
};
88-
89-
component._handlers = Object.create(null);
90-
88+
component._observers = { pre: blankObject(), post: blankObject() };
89+
component._handlers = blankObject();
9190
component._root = options._root || component;
9291
component._yield = options._yield;
9392
component._bind = options._bind;

test/js/samples/inline-style-unoptimized/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ function createText(data) {
2929
return document.createTextNode(data);
3030
}
3131

32+
function blankObject() {
33+
return Object.create(null);
34+
}
35+
3236
function destroy(detach) {
3337
this.destroy = noop;
3438
this.fire('destroy');
@@ -81,13 +85,8 @@ function get(key) {
8185
function init(component, options) {
8286
component.options = options;
8387

84-
component._observers = {
85-
pre: Object.create(null),
86-
post: Object.create(null)
87-
};
88-
89-
component._handlers = Object.create(null);
90-
88+
component._observers = { pre: blankObject(), post: blankObject() };
89+
component._handlers = blankObject();
9190
component._root = options._root || component;
9291
component._yield = options._yield;
9392
component._bind = options._bind;

test/js/samples/input-without-blowback-guard/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ function removeListener(node, event, handler) {
3333
node.removeEventListener(event, handler, false);
3434
}
3535

36+
function blankObject() {
37+
return Object.create(null);
38+
}
39+
3640
function destroy(detach) {
3741
this.destroy = noop;
3842
this.fire('destroy');
@@ -85,13 +89,8 @@ function get(key) {
8589
function init(component, options) {
8690
component.options = options;
8791

88-
component._observers = {
89-
pre: Object.create(null),
90-
post: Object.create(null)
91-
};
92-
93-
component._handlers = Object.create(null);
94-
92+
component._observers = { pre: blankObject(), post: blankObject() };
93+
component._handlers = blankObject();
9594
component._root = options._root || component;
9695
component._yield = options._yield;
9796
component._bind = options._bind;

test/js/samples/legacy-input-type/expected-bundle.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ function setInputType(input, type) {
3131
} catch (e) {}
3232
}
3333

34+
function blankObject() {
35+
return Object.create(null);
36+
}
37+
3438
function destroy(detach) {
3539
this.destroy = noop;
3640
this.fire('destroy');
@@ -83,13 +87,8 @@ function get(key) {
8387
function init(component, options) {
8488
component.options = options;
8589

86-
component._observers = {
87-
pre: Object.create(null),
88-
post: Object.create(null)
89-
};
90-
91-
component._handlers = Object.create(null);
92-
90+
component._observers = { pre: blankObject(), post: blankObject() };
91+
component._handlers = blankObject();
9392
component._root = options._root || component;
9493
component._yield = options._yield;
9594
component._bind = options._bind;

0 commit comments

Comments
 (0)