Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f2f390d

Browse files
committed
fix($parse): ensure CSP assignable expressions have assign()
Fixes regression where the `assign()` method was not added to chains of identifiers in CSP mode, introduced originally in b3b476d. Closes #9048
1 parent d04f316 commit f2f390d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ng/parse.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ function getterFn(path, options, fullExp) {
897897
if (pathKeysLength < 6) {
898898
fn = cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4], fullExp);
899899
} else {
900-
fn = function(scope, locals) {
900+
fn = function cspSafeGetter(scope, locals) {
901901
var i = 0, val;
902902
do {
903903
val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++],
@@ -926,14 +926,14 @@ function getterFn(path, options, fullExp) {
926926
var evaledFnGetter = new Function('s', 'l', code); // s=scope, l=locals
927927
/* jshint +W054 */
928928
evaledFnGetter.toString = valueFn(code);
929-
evaledFnGetter.assign = function(self, value) {
930-
return setter(self, path, value, path);
931-
};
932929

933930
fn = evaledFnGetter;
934931
}
935932

936933
fn.sharedGetter = true;
934+
fn.assign = function(self, value) {
935+
return setter(self, path, value, path);
936+
};
937937
getterFnCache[path] = fn;
938938
return fn;
939939
}

0 commit comments

Comments
 (0)