marko 5.29.1 → 5.30.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/bin/markoc.js +18 -18
- package/dist/core-tags/core/await/index.d.marko +10 -0
- package/dist/core-tags/core/await/renderer.js +5 -1
- package/dist/node_modules/@internal/components-beginComponent/index.js +13 -3
- package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +331 -0
- package/dist/node_modules/@internal/components-define-widget-legacy/index.js +18 -0
- package/dist/node_modules/@internal/components-define-widget-legacy/package.json +11 -0
- package/dist/node_modules/@internal/components-entry/index-browser.js +2 -2
- package/dist/node_modules/@internal/components-entry/index.js +73 -45
- package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +74 -0
- package/dist/node_modules/@internal/components-entry-legacy/index.js +15 -0
- package/dist/node_modules/@internal/components-entry-legacy/package.json +11 -0
- package/dist/node_modules/@internal/components-registry/index-browser.js +70 -43
- package/dist/node_modules/@internal/components-registry/index.js +2 -2
- package/dist/node_modules/@internal/components-util/index-browser.js +17 -17
- package/dist/node_modules/@internal/components-util/index.js +18 -8
- package/dist/node_modules/@internal/create-readable/index-browser.js +1 -1
- package/dist/node_modules/@internal/create-readable/index.js +9 -9
- package/dist/node_modules/@internal/set-immediate/index-browser.js +1 -1
- package/dist/node_modules/@internal/set-immediate/index-worker.js +2 -2
- package/dist/node_modules/@internal/set-immediate/index.js +2 -2
- package/dist/runtime/RenderResult.js +3 -3
- package/dist/runtime/components/Component.js +146 -148
- package/dist/runtime/components/ComponentDef.js +41 -27
- package/dist/runtime/components/ComponentsContext.js +6 -6
- package/dist/runtime/components/GlobalComponentsContext.js +3 -3
- package/dist/runtime/components/KeySequence.js +3 -3
- package/dist/runtime/components/ServerComponent.js +13 -13
- package/dist/runtime/components/State.js +27 -27
- package/dist/runtime/components/attach-detach.js +7 -7
- package/dist/runtime/components/defineComponent.js +5 -5
- package/dist/runtime/components/dom-data.js +6 -6
- package/dist/runtime/components/event-delegation.js +10 -10
- package/dist/runtime/components/legacy/browser.json +9 -0
- package/dist/runtime/components/legacy/defineComponent-legacy.js +32 -0
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +171 -0
- package/dist/runtime/components/legacy/defineWidget-legacy.js +1 -0
- package/dist/runtime/components/legacy/dependencies/html.js +3 -0
- package/dist/runtime/components/legacy/dependencies/index.js +178 -0
- package/dist/runtime/components/legacy/dependencies/vdom.js +3 -0
- package/dist/runtime/components/legacy/index.js +1 -0
- package/dist/runtime/components/legacy/jquery.js +51 -0
- package/dist/runtime/components/legacy/ready.js +152 -0
- package/dist/runtime/components/legacy/renderer-legacy.js +230 -0
- package/dist/runtime/components/renderer.js +30 -26
- package/dist/runtime/components/update-manager.js +10 -10
- package/dist/runtime/createOut.js +1 -1
- package/dist/runtime/dom-insert.js +5 -5
- package/dist/runtime/helpers/_change-case.js +2 -2
- package/dist/runtime/helpers/dynamic-tag.js +7 -9
- package/dist/runtime/helpers/style-value.js +7 -2
- package/dist/runtime/html/AsyncStream.js +20 -20
- package/dist/runtime/html/BufferedWriter.js +2 -2
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +19 -6
- package/dist/runtime/html/helpers/attrs.js +7 -0
- package/dist/runtime/html/helpers/data-marko.js +2 -2
- package/dist/runtime/html/helpers/escape-quotes.js +1 -1
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/html/helpers/merge-attrs.js +38 -7
- package/dist/runtime/html/index.js +2 -2
- package/dist/runtime/renderable.js +9 -6
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +86 -86
- package/dist/runtime/vdom/VComponent.js +3 -3
- package/dist/runtime/vdom/VDocumentFragment.js +7 -7
- package/dist/runtime/vdom/VElement.js +61 -50
- package/dist/runtime/vdom/VFragment.js +8 -8
- package/dist/runtime/vdom/VNode.js +36 -36
- package/dist/runtime/vdom/VText.js +8 -8
- package/dist/runtime/vdom/helpers/attrs.js +24 -4
- package/dist/runtime/vdom/helpers/merge-attrs.js +16 -0
- package/dist/runtime/vdom/helpers/v-element.js +1 -1
- package/dist/runtime/vdom/helpers/v-text.js +1 -1
- package/dist/runtime/vdom/hot-reload.js +19 -19
- package/dist/runtime/vdom/index.js +2 -2
- package/dist/runtime/vdom/morphdom/fragment.js +5 -5
- package/dist/runtime/vdom/morphdom/helpers.js +5 -5
- package/dist/runtime/vdom/morphdom/index.js +56 -56
- package/dist/runtime/vdom/morphdom/specialElHandlers.js +7 -7
- package/dist/runtime/vdom/preserve-attrs.js +1 -1
- package/dist/runtime/vdom/vdom.js +14 -14
- package/docs/10-awesome-marko-features.md +1 -1
- package/docs/body-content.md +3 -3
- package/docs/class-components.md +6 -6
- package/docs/cloudflare-workers.md +3 -3
- package/docs/compiler.md +5 -5
- package/docs/express.md +2 -2
- package/docs/http.md +1 -1
- package/docs/koa.md +1 -1
- package/docs/lasso.md +1 -1
- package/docs/marko-vs-react.md +2 -2
- package/docs/rendering.md +6 -6
- package/docs/rollup.md +30 -30
- package/docs/troubleshooting-streaming.md +1 -1
- package/docs/typescript.md +1 -1
- package/docs/vite.md +3 -3
- package/docs/webpack.md +25 -25
- package/docs/why-is-marko-fast.md +2 -2
- package/index.d.ts +1 -0
- package/legacy-components-browser.marko +15 -0
- package/legacy-components.js +7 -0
- package/package.json +51 -45
- package/src/compiler/config.js +1 -1
- package/src/compiler/index.js +5 -5
- package/src/core-tags/core/__flush_here_and_after__.js +1 -1
- package/src/core-tags/core/await/AsyncValue.js +1 -1
- package/src/core-tags/core/await/index.d.marko +10 -0
- package/src/core-tags/core/await/renderer.js +8 -4
- package/src/core-tags/core/await/reorderer-renderer.js +1 -1
- package/src/node-require/browser-refresh.js +2 -2
- package/src/node-require/index.js +2 -2
- package/src/node_modules/@internal/components-beginComponent/index.js +16 -6
- package/src/node_modules/@internal/components-define-widget-legacy/index-browser.js +331 -0
- package/src/node_modules/@internal/components-define-widget-legacy/index.js +18 -0
- package/src/node_modules/@internal/components-define-widget-legacy/package.json +11 -0
- package/src/node_modules/@internal/components-entry/index.js +65 -37
- package/src/node_modules/@internal/components-entry-legacy/index-browser.js +74 -0
- package/src/node_modules/@internal/components-entry-legacy/index.js +15 -0
- package/src/node_modules/@internal/components-entry-legacy/package.json +11 -0
- package/src/node_modules/@internal/components-registry/index-browser.js +33 -6
- package/src/node_modules/@internal/components-util/index.js +10 -0
- package/src/runtime/RenderResult.js +3 -3
- package/src/runtime/components/Component.js +16 -18
- package/src/runtime/components/ComponentDef.js +22 -8
- package/src/runtime/components/ComponentsContext.js +1 -1
- package/src/runtime/components/State.js +2 -2
- package/src/runtime/components/attach-detach.js +1 -1
- package/src/runtime/components/dom-data.js +1 -1
- package/src/runtime/components/legacy/browser.json +9 -0
- package/src/runtime/components/legacy/defineComponent-legacy.js +32 -0
- package/src/runtime/components/legacy/defineRenderer-legacy.js +171 -0
- package/src/runtime/components/legacy/defineWidget-legacy.js +1 -0
- package/src/runtime/components/legacy/dependencies/html.js +3 -0
- package/src/runtime/components/legacy/dependencies/index.js +178 -0
- package/src/runtime/components/legacy/dependencies/vdom.js +3 -0
- package/src/runtime/components/legacy/index.js +1 -0
- package/src/runtime/components/legacy/jquery.js +51 -0
- package/src/runtime/components/legacy/ready.js +152 -0
- package/src/runtime/components/legacy/renderer-legacy.js +230 -0
- package/src/runtime/components/renderer.js +4 -0
- package/src/runtime/components/update-manager.js +1 -1
- package/src/runtime/dom-insert.js +1 -1
- package/src/runtime/helpers/dynamic-tag.js +2 -4
- package/src/runtime/helpers/style-value.js +7 -2
- package/src/runtime/html/AsyncStream.js +5 -5
- package/src/runtime/html/BufferedWriter.js +1 -1
- package/src/runtime/html/StringWriter.js +1 -1
- package/src/runtime/html/helpers/attr.js +15 -2
- package/src/runtime/html/helpers/attrs.js +7 -0
- package/src/runtime/html/helpers/merge-attrs.js +38 -7
- package/src/runtime/html/hot-reload.js +1 -1
- package/src/runtime/html/index.js +2 -2
- package/src/runtime/renderable.js +5 -2
- package/src/runtime/vdom/AsyncVDOMBuilder.js +2 -2
- package/src/runtime/vdom/VComponent.js +1 -1
- package/src/runtime/vdom/VDocumentFragment.js +1 -1
- package/src/runtime/vdom/VElement.js +17 -6
- package/src/runtime/vdom/VFragment.js +1 -1
- package/src/runtime/vdom/VNode.js +1 -1
- package/src/runtime/vdom/VText.js +1 -1
- package/src/runtime/vdom/helpers/attrs.js +26 -6
- package/src/runtime/vdom/helpers/merge-attrs.js +16 -0
- package/src/runtime/vdom/hot-reload.js +1 -1
- package/src/runtime/vdom/index.js +2 -2
- package/src/runtime/vdom/morphdom/fragment.js +1 -1
- package/src/runtime/vdom/morphdom/specialElHandlers.js +1 -1
- package/src/taglib/index.js +1 -1
- package/tags-html.d.ts +9 -0
- package/dist/core-tags/core/await/index.marko +0 -13
- package/src/core-tags/core/await/index.marko +0 -13
@@ -8,7 +8,7 @@ var markoAttr = require("./helpers/data-marko");
|
|
8
8
|
var escapeXmlHelper = require("./helpers/escape-xml");
|
9
9
|
var parseHTML = require("../vdom/parse-html");
|
10
10
|
var escapeXmlOrNullish = escapeXmlHelper.x;
|
11
|
-
var escapeXmlString = escapeXmlHelper.
|
11
|
+
var escapeXmlString = escapeXmlHelper.bl_;
|
12
12
|
var selfClosingTags = require("self-closing-tags");
|
13
13
|
|
14
14
|
function noop() {}
|
@@ -93,8 +93,8 @@ function AsyncStream(global, writer, parentOut) {
|
|
93
93
|
|
94
94
|
this.h_ = null;
|
95
95
|
this.j_ = null;
|
96
|
-
this.
|
97
|
-
this.
|
96
|
+
this.b__ = null;
|
97
|
+
this.bm_ = false;
|
98
98
|
}
|
99
99
|
|
100
100
|
AsyncStream.DEFAULT_TIMEOUT = 10000;
|
@@ -114,8 +114,8 @@ AsyncStream.enableAsyncStackTrace = function () {
|
|
114
114
|
|
115
115
|
var proto = AsyncStream.prototype = {
|
116
116
|
constructor: AsyncStream,
|
117
|
-
|
118
|
-
|
117
|
+
I_: typeof document === "object" && document,
|
118
|
+
bn_: true,
|
119
119
|
|
120
120
|
sync: function () {
|
121
121
|
this._sync = true;
|
@@ -139,7 +139,7 @@ var proto = AsyncStream.prototype = {
|
|
139
139
|
return this;
|
140
140
|
},
|
141
141
|
|
142
|
-
|
142
|
+
af_: function () {
|
143
143
|
return this._state.writer.toString();
|
144
144
|
},
|
145
145
|
|
@@ -147,14 +147,14 @@ var proto = AsyncStream.prototype = {
|
|
147
147
|
* Legacy...
|
148
148
|
*/
|
149
149
|
getOutput: function () {
|
150
|
-
return this.
|
150
|
+
return this.af_();
|
151
151
|
},
|
152
152
|
|
153
153
|
toString: function () {
|
154
154
|
return this._state.writer.toString();
|
155
155
|
},
|
156
156
|
|
157
|
-
|
157
|
+
bo_: function () {
|
158
158
|
this._result = this._result || new RenderResult(this);
|
159
159
|
return this._result;
|
160
160
|
},
|
@@ -205,7 +205,7 @@ var proto = AsyncStream.prototype = {
|
|
205
205
|
}
|
206
206
|
|
207
207
|
this._lastCount++;
|
208
|
-
newStream.
|
208
|
+
newStream.bm_ = true;
|
209
209
|
}
|
210
210
|
|
211
211
|
name = options.name;
|
@@ -251,7 +251,7 @@ var proto = AsyncStream.prototype = {
|
|
251
251
|
}
|
252
252
|
|
253
253
|
if (state.events !== state.stream) {
|
254
|
-
state.events.emit("finish", this.
|
254
|
+
state.events.emit("finish", this.bo_());
|
255
255
|
}
|
256
256
|
},
|
257
257
|
|
@@ -323,7 +323,7 @@ var proto = AsyncStream.prototype = {
|
|
323
323
|
parentOut._handleChildDone(this);
|
324
324
|
}
|
325
325
|
} else {
|
326
|
-
if (childOut.
|
326
|
+
if (childOut.bm_) {
|
327
327
|
this._lastCount--;
|
328
328
|
}
|
329
329
|
|
@@ -364,7 +364,7 @@ var proto = AsyncStream.prototype = {
|
|
364
364
|
var state = this._state;
|
365
365
|
|
366
366
|
if (event === "finish" && state.finished === true) {
|
367
|
-
callback(this.
|
367
|
+
callback(this.bo_());
|
368
368
|
} else if (event === "last") {
|
369
369
|
this.onLast(callback);
|
370
370
|
} else {
|
@@ -378,7 +378,7 @@ var proto = AsyncStream.prototype = {
|
|
378
378
|
var state = this._state;
|
379
379
|
|
380
380
|
if (event === "finish" && state.finished === true) {
|
381
|
-
callback(this.
|
381
|
+
callback(this.bo_());
|
382
382
|
} else if (event === "last") {
|
383
383
|
this.onLast(callback);
|
384
384
|
} else {
|
@@ -503,7 +503,7 @@ var proto = AsyncStream.prototype = {
|
|
503
503
|
return newOut;
|
504
504
|
},
|
505
505
|
|
506
|
-
|
506
|
+
bk_: function (
|
507
507
|
tagName,
|
508
508
|
elementAttrs,
|
509
509
|
key,
|
@@ -537,7 +537,7 @@ var proto = AsyncStream.prototype = {
|
|
537
537
|
this.write(str);
|
538
538
|
},
|
539
539
|
|
540
|
-
|
540
|
+
bi_: function (
|
541
541
|
name,
|
542
542
|
elementAttrs,
|
543
543
|
key,
|
@@ -603,14 +603,14 @@ var proto = AsyncStream.prototype = {
|
|
603
603
|
}
|
604
604
|
},
|
605
605
|
|
606
|
-
|
606
|
+
ae_: function (host) {
|
607
607
|
var node = this._node;
|
608
608
|
|
609
609
|
if (!node) {
|
610
610
|
var nextEl;
|
611
611
|
var fragment;
|
612
|
-
var html = this.
|
613
|
-
if (!host) host = this.
|
612
|
+
var html = this.af_();
|
613
|
+
if (!host) host = this.I_;
|
614
614
|
var doc = host.ownerDocument || host;
|
615
615
|
|
616
616
|
if (html) {
|
@@ -654,13 +654,13 @@ var proto = AsyncStream.prototype = {
|
|
654
654
|
c: function (componentDef, key, customEvents) {
|
655
655
|
this.h_ = componentDef;
|
656
656
|
this.j_ = key;
|
657
|
-
this.
|
657
|
+
this.b__ = customEvents;
|
658
658
|
}
|
659
659
|
};
|
660
660
|
|
661
661
|
// alias:
|
662
662
|
proto.w = proto.write;
|
663
|
-
proto.
|
663
|
+
proto.bj_ = proto.endElement;
|
664
664
|
|
665
665
|
module.exports = AsyncStream;
|
666
666
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const immediate = require("@internal/set-immediate");
|
4
|
-
const setImmediate = immediate.
|
5
|
-
const clearImmediate = immediate.
|
4
|
+
const setImmediate = immediate.ab_;
|
5
|
+
const clearImmediate = immediate.ac_;
|
6
6
|
const StringWriter = require("./StringWriter");
|
7
7
|
|
8
8
|
/**
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
var attrHelper = require("./attr");
|
3
|
-
var notEmptyAttr = attrHelper.
|
4
|
-
var isEmptyAttrValue = attrHelper.
|
3
|
+
var notEmptyAttr = attrHelper.bp_;
|
4
|
+
var isEmptyAttrValue = attrHelper.bq_;
|
5
5
|
var classHelper = require("./class-attr");
|
6
6
|
var styleHelper = require("./style-attr");
|
7
7
|
|
@@ -2,12 +2,13 @@
|
|
2
2
|
|
3
3
|
var escapeQuoteHelpers = require("./escape-quotes");
|
4
4
|
var escapeDoubleQuotes = escapeQuoteHelpers.y_;
|
5
|
-
var escapeSingleQuotes = escapeQuoteHelpers.
|
5
|
+
var escapeSingleQuotes = escapeQuoteHelpers.br_;
|
6
|
+
|
6
7
|
|
7
8
|
module.exports = maybeEmptyAttr;
|
8
9
|
|
9
|
-
maybeEmptyAttr.
|
10
|
-
maybeEmptyAttr.
|
10
|
+
maybeEmptyAttr.bp_ = notEmptyAttr;
|
11
|
+
maybeEmptyAttr.bq_ = isEmpty;
|
11
12
|
|
12
13
|
function maybeEmptyAttr(name, value) {
|
13
14
|
if (isEmpty(value)) {
|
@@ -26,9 +27,21 @@ function notEmptyAttr(name, value) {
|
|
26
27
|
case "number":
|
27
28
|
return " " + name + "=" + value;
|
28
29
|
case "object":
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
switch (value.toString) {
|
31
|
+
case Object.prototype.toString:
|
32
|
+
case Array.prototype.toString:
|
33
|
+
// eslint-disable-next-line no-constant-condition
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
return " " + name + singleQuote(JSON.stringify(value), 2);
|
42
|
+
case RegExp.prototype.toString:
|
43
|
+
return " " + name + guessQuotes(value.source);}}
|
44
|
+
|
32
45
|
|
33
46
|
|
34
47
|
return " " + name + guessQuotes(value + "");
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
|
3
4
|
var dynamicAttrHelper = require("./_dynamic-attr");
|
4
5
|
|
5
6
|
module.exports = function attrs(arg) {
|
@@ -11,6 +12,12 @@ module.exports = function attrs(arg) {
|
|
11
12
|
}
|
12
13
|
return result;
|
13
14
|
case "string":
|
15
|
+
// eslint-disable-next-line no-constant-condition
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
14
21
|
return arg;
|
15
22
|
default:
|
16
23
|
return "";}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var escapeQuoteHelpers = require("./escape-quotes");
|
4
|
-
var escapeSingleQuotes = escapeQuoteHelpers.
|
4
|
+
var escapeSingleQuotes = escapeQuoteHelpers.br_;
|
5
5
|
var escapeDoubleQuotes = escapeQuoteHelpers.y_;
|
6
6
|
var FLAG_WILL_RERENDER_IN_BROWSER = 1;
|
7
7
|
// var FLAG_HAS_RENDER_BODY = 2;
|
@@ -27,7 +27,7 @@ module.exports = function dataMarko(out, componentDef, props, key) {
|
|
27
27
|
result +=
|
28
28
|
' data-marko-key="' +
|
29
29
|
escapeDoubleQuotes(
|
30
|
-
componentDef.
|
30
|
+
componentDef.aK_(key) + " " + componentDef.id) +
|
31
31
|
|
32
32
|
'"';
|
33
33
|
}
|
@@ -1,20 +1,51 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
|
3
4
|
var dynamicAttrHelper = require("./_dynamic-attr");
|
4
5
|
|
5
6
|
/**
|
6
7
|
* Merges attribute objects into a string.
|
7
8
|
*/
|
8
9
|
module.exports = function mergeAttrs() {
|
9
|
-
var
|
10
|
+
var i = arguments.length;
|
11
|
+
var last = arguments[--i];
|
10
12
|
var seen = new Set();
|
13
|
+
var result = "";
|
14
|
+
var attrName;
|
15
|
+
|
16
|
+
if (typeof last === "string") {
|
17
|
+
// eslint-disable-next-line no-constant-condition
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
result += last[0] === " " ? last : " " + last;
|
25
|
+
} else {
|
26
|
+
for (attrName in last) {
|
27
|
+
result += dynamicAttrHelper(attrName, last[attrName]);
|
28
|
+
seen.add(attrName);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
while (i) {
|
33
|
+
var arg = arguments[--i];
|
34
|
+
if (typeof arg === "string") {
|
35
|
+
// eslint-disable-next-line no-constant-condition
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
11
41
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
42
|
+
result += arg[0] === " " ? arg : " " + arg;
|
43
|
+
} else {
|
44
|
+
for (attrName in arg) {
|
45
|
+
if (!seen.has(attrName)) {
|
46
|
+
result += dynamicAttrHelper(attrName, arg[attrName]);
|
47
|
+
seen.add(attrName);
|
48
|
+
}
|
18
49
|
}
|
19
50
|
}
|
20
51
|
}
|
@@ -15,13 +15,13 @@ exports.t = function createTemplate(typeName) {
|
|
15
15
|
};
|
16
16
|
|
17
17
|
function Template(typeName) {
|
18
|
-
this.
|
18
|
+
this.path = this.X_ = typeName;
|
19
19
|
}
|
20
20
|
|
21
21
|
Template.prototype.stream = require("@internal/create-readable");
|
22
22
|
|
23
23
|
var AsyncStream = require("./AsyncStream");
|
24
|
-
require("../createOut").
|
24
|
+
require("../createOut").bc_(
|
25
25
|
Template.prototype.createOut = function createOut(
|
26
26
|
globalData,
|
27
27
|
writer,
|
@@ -1,5 +1,7 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var defaultCreateOut = require("./createOut");
|
4
|
+
var setImmediate = require("@internal/set-immediate").ab_;
|
3
5
|
var extend = require("raptor-util/extend");
|
4
6
|
|
5
7
|
function safeRender(renderFunc, finalData, finalOut, shouldEnd) {
|
@@ -27,6 +29,7 @@ module.exports = function (target, renderer) {
|
|
27
29
|
var createOut = target.createOut || renderer.createOut || defaultCreateOut;
|
28
30
|
|
29
31
|
return extend(target, {
|
32
|
+
_: renderFunc,
|
30
33
|
createOut: createOut,
|
31
34
|
|
32
35
|
renderToString: function (data, callback) {
|
@@ -70,7 +73,7 @@ module.exports = function (target, renderer) {
|
|
70
73
|
}
|
71
74
|
|
72
75
|
render(localData, out);
|
73
|
-
return out.
|
76
|
+
return out.bo_();
|
74
77
|
},
|
75
78
|
|
76
79
|
/**
|
@@ -96,7 +99,7 @@ module.exports = function (target, renderer) {
|
|
96
99
|
var finalData;
|
97
100
|
var globalData;
|
98
101
|
var render = renderFunc || this._;
|
99
|
-
var shouldBuffer = this.
|
102
|
+
var shouldBuffer = this._Y_;
|
100
103
|
var shouldEnd = true;
|
101
104
|
|
102
105
|
if (data) {
|
@@ -108,7 +111,7 @@ module.exports = function (target, renderer) {
|
|
108
111
|
finalData = {};
|
109
112
|
}
|
110
113
|
|
111
|
-
if (out && out.
|
114
|
+
if (out && out.bn_) {
|
112
115
|
finalOut = out;
|
113
116
|
shouldEnd = false;
|
114
117
|
extend(out.global, globalData);
|
@@ -127,7 +130,7 @@ module.exports = function (target, renderer) {
|
|
127
130
|
if (callback) {
|
128
131
|
finalOut.
|
129
132
|
on("finish", function () {
|
130
|
-
callback(null, finalOut.
|
133
|
+
callback(null, finalOut.bo_(), finalOut);
|
131
134
|
}).
|
132
135
|
once("error", callback);
|
133
136
|
}
|