fix: check prototype property access in strict-mode (#1736)
This commit is contained in:
@@ -124,7 +124,7 @@ export function template(templateSpec, env) {
|
||||
loc: loc
|
||||
});
|
||||
}
|
||||
return obj[name];
|
||||
return container.lookupProperty(obj, name);
|
||||
},
|
||||
lookupProperty: function(parent, propertyName) {
|
||||
let result = parent[propertyName];
|
||||
|
||||
@@ -298,6 +298,10 @@ describe('security issues', function() {
|
||||
checkProtoPropertyAccess({ compat: true });
|
||||
});
|
||||
|
||||
describe('in strict-mode', function() {
|
||||
checkProtoPropertyAccess({ strict: true });
|
||||
});
|
||||
|
||||
function checkProtoPropertyAccess(compileOptions) {
|
||||
it('should be prohibited by default and log a warning', function() {
|
||||
var spy = sinon.spy(console, 'error');
|
||||
|
||||
Reference in New Issue
Block a user