Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$!a.b, 若a不存在,会报错 #54

Closed
yangxuanxing opened this issue Nov 26, 2015 · 4 comments · Fixed by #55
Closed

$!a.b, 若a不存在,会报错 #54

yangxuanxing opened this issue Nov 26, 2015 · 4 comments · Fixed by #55

Comments

@yangxuanxing
Copy link

$!a.b, 若a不存在,线上解析没问题,mock会js报错

推荐修改src/compile/references.js

utils.some(ast.path, function(property){
  //第三个参数,返回后面的参数ast
  ret = ret && this.getAttributes(property, ret, ast);
}, this);
@shepherdwind
Copy link
Owner

mock会js报错是什么意思啊?

@shepherdwind
Copy link
Owner

执行js是啥?贴一个运行的代码来看看。

@yangxuanxing
Copy link
Author

不好意思,前两天没注意邮件,上面描述的有点问题,报错代码如下:

var Velocity = require('velocityjs');
Velocity.render('this thows error: $!a.b.c', {a: {b: null}});

@shepherdwind
Copy link
Owner

0.7.3

上周请假了,今天刚回来。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants