We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d27350 commit 48e3ab3Copy full SHA for 48e3ab3
test/specs/utils/object.spec.ts
@@ -1,5 +1,6 @@
1
import { expect } from 'chai';
2
import { deepAssign } from '../../../src/shared/object';
3
+import { addScopeOptions } from '../../../src/scopes/scope-service';
4
5
describe('utils', () => {
6
describe('object', () => {
@@ -109,6 +110,14 @@ describe('utils', () => {
109
110
expect(copy.test).to.have.property('protoFn').that.is.a('function');
111
});
112
113
+ it('ignore prototype property', () => {
114
+ const BAD_JSON = JSON.parse('{"__proto__":{"polluted":true}}');
115
+ const empty_scope = {};
116
+
117
+ addScopeOptions(empty_scope, BAD_JSON);
118
+ expect(empty_scope).not.to.have.property('polluted');
119
+ });
120
121
if (Object.getOwnPropertySymbols) {
122
it('should copy symbol based objects', () => {
123
const symbol = Symbol('test');
0 commit comments