Skip to content

Commit c1e82f6

Browse files
committed
single underscore for component private properties
1 parent 7dd129a commit c1e82f6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/generators/dom/index.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,18 @@ export default function dom ( parsed, source, options, names ) {
235235
}
236236

237237
if ( generator.hasComponents ) {
238-
builders.init.addLine( `this.__renderHooks = [];` );
238+
builders.init.addLine( `this._renderHooks = [];` );
239239
}
240240

241241
if ( generator.hasComplexBindings ) {
242242
builders.init.addBlock( deindent`
243-
this.__bindings = [];
243+
this._bindings = [];
244244
this._fragment = renderMainFragment( this._state, this );
245245
if ( options.target ) this._fragment.mount( options.target, null );
246-
while ( this.__bindings.length ) this.__bindings.pop()();
246+
while ( this._bindings.length ) this._bindings.pop()();
247247
` );
248248

249-
builders.set.addLine( `while ( this.__bindings.length ) this.__bindings.pop()();` );
249+
builders.set.addLine( `while ( this._bindings.length ) this._bindings.pop()();` );
250250
} else {
251251
builders.init.addBlock( deindent`
252252
this._fragment = renderMainFragment( this._state, this );
@@ -256,8 +256,8 @@ export default function dom ( parsed, source, options, names ) {
256256

257257
if ( generator.hasComponents ) {
258258
const statement = deindent`
259-
while ( this.__renderHooks.length ) {
260-
var hook = this.__renderHooks.pop();
259+
while ( this._renderHooks.length ) {
260+
var hook = this._renderHooks.pop();
261261
hook.fn.call( hook.context );
262262
}
263263
`;
@@ -269,7 +269,7 @@ export default function dom ( parsed, source, options, names ) {
269269
if ( templateProperties.onrender ) {
270270
builders.init.addBlock( deindent`
271271
if ( options._root ) {
272-
options._root.__renderHooks.push({ fn: template.onrender, context: this });
272+
options._root._renderHooks.push({ fn: template.onrender, context: this });
273273
} else {
274274
template.onrender.call( this );
275275
}

src/generators/dom/visitors/attributes/binding/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default function createBinding ( generator, node, attribute, current, loc
8787
local.init.addBlock( deindent`
8888
var ${local.name}_updating = false;
8989
90-
component.__bindings.push( function () {
90+
component._bindings.push( function () {
9191
${local.name}.observe( '${attribute.name}', function ( value ) {
9292
${local.name}_updating = true;
9393
${setter}
@@ -128,6 +128,6 @@ export default function createBinding ( generator, node, attribute, current, loc
128128

129129
if ( node.name === 'select' ) {
130130
generator.hasComplexBindings = true;
131-
local.init.addLine( `component.__bindings.push( ${handler} )` );
131+
local.init.addLine( `component._bindings.push( ${handler} )` );
132132
}
133133
}

0 commit comments

Comments
 (0)