Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
errorrik committed Jan 23, 2019
1 parent 0a7099c commit 7c25d80
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/browser/ie.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @file ie版本号
*/

// #[begin] allua
// #[begin] allua
/**
* 从userAgent中ie版本号的匹配信息
*
Expand Down
4 changes: 2 additions & 2 deletions src/parser/parse-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var readUnaryExpr = require('./read-unary-expr');
var directiveParsers = {
'for': function (value) {
var walker = new Walker(value);
var match = walker.match(/^\s*([\$0-9a-z_]+)(\s*,\s*([\$0-9a-z_]+))?\s+in\s+/ig, 1);
var match = walker.match(/^\s*([$0-9a-z_]+)(\s*,\s*([$0-9a-z_]+))?\s+in\s+/ig, 1);

if (match) {
var directive = {
Expand Down Expand Up @@ -64,7 +64,7 @@ var directiveParsers = {
};
},

'else': function (value) {
'else': function () {
return {
value: {}
};
Expand Down
5 changes: 3 additions & 2 deletions src/util/union-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
*/
function unionKeys(obj1, obj2) {
var result = [];
var key;

for (var key in obj1) {
for (key in obj1) {
if (obj1.hasOwnProperty(key)) {
result.push(key);
}
}

for (var key in obj2) {
for (key in obj2) {
if (obj2.hasOwnProperty(key)) {
!obj1[key] && result.push(key);
}
Expand Down
4 changes: 2 additions & 2 deletions src/view/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ var warn = require('../util/warn');
*/
function Component(options) { // eslint-disable-line

/* eslint-disable no-console */
// #[begin] error
for (var key in Component.prototype) {
if (this[key] !== Component.prototype[key]) {
/* eslint-disable max-len */
warn('\`' + key + '\` is a reserved key of san components. Overriding this property may cause unknown exceptions.');
/* eslint-enable max-len */
}
}
// #[end]
/* eslint-disable no-console */


options = options || {};
Expand Down
1 change: 1 addition & 0 deletions src/view/create-reverse-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var SlotNode = require('./slot-node');
var ForNode = require('./for-node');
var IfNode = require('./if-node');
var TemplateNode = require('./template-node');
var AsyncComponent = require('./async-component');

// #[begin] reverse
/**
Expand Down
1 change: 1 addition & 0 deletions src/view/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var getNodePath = require('./get-node-path');
/**
* 元素节点类
*
* @class
* @param {Object} aNode 抽象节点
* @param {Component} owner 所属组件环境
* @param {Model=} scope 所属数据环境
Expand Down
1 change: 1 addition & 0 deletions src/view/for-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function createForDirectiveChild(forElement, item, index) {
/**
* for 指令节点类
*
* @class
* @param {Object} aNode 抽象节点
* @param {Component} owner 所属组件环境
* @param {Model=} scope 所属数据环境
Expand Down
2 changes: 1 addition & 1 deletion src/view/get-prop-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var HTML_ATTR_PROP_MAP = {
* @type {Object}
*/
var defaultElementPropHandler = {
prop: function (el, value, name, element) {
prop: function (el, value, name) {
var propName = HTML_ATTR_PROP_MAP[name] || name;
value = value == null ? '' : value;
// input 的 type 是个特殊属性,其实也应该用 setAttribute
Expand Down
1 change: 1 addition & 0 deletions src/view/if-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var nodeOwnSimpleDispose = require('./node-own-simple-dispose');
/**
* if 指令节点类
*
* @class
* @param {Object} aNode 抽象节点
* @param {Component} owner 所属组件环境
* @param {Model=} scope 所属数据环境
Expand Down
1 change: 1 addition & 0 deletions src/view/slot-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var nodeOwnOnlyChildrenAttach = require('./node-own-only-children-attach');
/**
* slot 节点类
*
* @class
* @param {Object} aNode 抽象节点
* @param {Component} owner 所属组件环境
* @param {Model=} scope 所属数据环境
Expand Down
1 change: 1 addition & 0 deletions src/view/template-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var nodeOwnOnlyChildrenAttach = require('./node-own-only-children-attach');
/**
* template 节点类
*
* @class
* @param {Object} aNode 抽象节点
* @param {Component} owner 所属组件环境
* @param {Model=} scope 所属数据环境
Expand Down
1 change: 1 addition & 0 deletions src/view/text-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var getNodePath = require('./get-node-path');
/**
* text 节点类
*
* @class
* @param {Object} aNode 抽象节点
* @param {Component} owner 所属组件环境
* @param {Model=} scope 所属数据环境
Expand Down

0 comments on commit 7c25d80

Please sign in to comment.