diff options
| author | rodyhaddad | 2013-10-30 15:14:00 -0400 | 
|---|---|---|
| committer | Igor Minar | 2013-11-22 00:19:08 -0800 | 
| commit | 40647b179c473f3f470bb1b3237d6f006269582f (patch) | |
| tree | 3b194359bc7b4e2c6b725fd5a315f06b4ee4857b /src/ng/parse.js | |
| parent | 0421cb4200e672818ed10996e92311404c150c3a (diff) | |
| download | angular.js-40647b179c473f3f470bb1b3237d6f006269582f.tar.bz2 | |
fix($parse): allow for new lines in expr when promise unwrapping is on
Previously, when unwrapping promises was set to `true`,
an error would occur if a parsed expression had a
new line in it.
This was because when generating the `evaledFnGetter` code,
a new line in an parsed expression would create a new line
in a JS string in that code, which is illegal. That is:
```js
pw("A+
B")
```
Closes #4718
Diffstat (limited to 'src/ng/parse.js')
| -rw-r--r-- | src/ng/parse.js | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/src/ng/parse.js b/src/ng/parse.js index c93d07de..3be98573 100644 --- a/src/ng/parse.js +++ b/src/ng/parse.js @@ -1017,7 +1017,7 @@ function getterFn(path, options, fullExp) {                        : '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '["' + key + '"]' + ';\n' +                (options.unwrapPromises                  ? 'if (s && s.then) {\n' + -                  ' pw("' + fullExp.replace(/\"/g, '\\"') + '");\n' + +                  ' pw("' + fullExp.replace(/(["\r\n])/g, '\\$1') + '");\n' +                    ' if (!("$$v" in s)) {\n' +                      ' p=s;\n' +                      ' p.$$v = undefined;\n' + | 
