Skip to content

Commit

Permalink
Merge branch 'v4.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
aui committed May 4, 2017
2 parents 435f9b0 + 936d9f3 commit d0ac52f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ install:
- npm install
script:
- npm run build
- export NODE_ENV=production && node_modules/mocha/bin/_mocha --ui exports --colors 'test/**/*.js'
- npm test
after_success:
- npm run coverage
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v4.8.1

1. 修复低版本 NodeJS 报错问题

## v4.8.0

1. 过滤器支持在运行时注入 [#4](https://github.com/aui/art-template-loader/issues/4)
Expand Down
6 changes: 4 additions & 2 deletions lib/compile/adapter/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var toType = function toType(value) {
};

/**
* 继承
* 快速继承默认配置
* @param {Object} options
* @param {?Object} defaults
* @return {Object}
Expand All @@ -24,7 +24,9 @@ var extend = function extend(target, defaults) {

if (object) {
for (var index in target) {
object[index] = extend(target[index], object[index]);
if (target.hasOwnProperty(index)) {
object[index] = extend(target[index], object[index]);
}
}
return object;
} else {
Expand Down
6 changes: 3 additions & 3 deletions lib/template-web.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "art-template",
"description": "JavaScript Template Engine",
"homepage": "http://aui.github.com/art-template/",
"version": "4.8.0",
"version": "4.8.1",
"keywords": [
"template"
],
Expand Down
7 changes: 4 additions & 3 deletions src/compile/adapter/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const toType = value => {


/**
* 继承
* 快速继承默认配置
* @param {Object} options
* @param {?Object} defaults
* @return {Object}
Expand All @@ -23,13 +23,14 @@ const extend = function (target, defaults) {

if (object) {
for (let index in target) {
object[index] = extend(target[index], object[index]);
if (target.hasOwnProperty(index)) {
object[index] = extend(target[index], object[index]);
}
}
return object;
} else {
return target;
}
};


module.exports = extend;
1 change: 1 addition & 0 deletions test/compile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ module.exports = {
test(`{{time * 1000 | dateFormat 'yyyy-MM-dd'}}`, {
time: 1491566794
}, `2017-04-07`, options);
test(`{{3.14 | parseInt}}`, {}, `3`, options);
test(`{{time | dateFormat:'yyyy-MM-dd'}}`, {
time: 1491566794863
}, `2017-04-07`, options); // ... v3 compat ...
Expand Down

0 comments on commit d0ac52f

Please sign in to comment.