Skip to content

Commit

Permalink
fix: <enhancement - handle the exception when cc.object is undefined>
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake.Zheng authored and Jake.Zheng committed Sep 16, 2018
1 parent b308cf0 commit 84a0c3a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions demo/components/comp6.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<template>
<div>{{cc.a}}</div>
<div>{{cc.b}}</div>
<div>{{cc.user.name}}</div>
<button uku-onclick="cc.sayHello()">click</button>
</template>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion dist/uku.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/uku.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/util/UkuleleUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,12 @@ export class UkuleleUtil {
attrName = attrName.replace(pattern2, "." + alias);

});

var result = eval(attrName);
var result;
try{
result = eval(attrName);
}catch(err){
result = '';
}
tempScope = null;
return result;
})();
Expand Down

0 comments on commit 84a0c3a

Please sign in to comment.