Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
2.5 KB
|
Line | |
---|
1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { global } from '../util/global';
|
---|
9 | /**
|
---|
10 | * Creates an instance of a `Proxy` and creates with an empty target object and binds it to the
|
---|
11 | * provided handler.
|
---|
12 | *
|
---|
13 | * The reason why this function exists is because IE doesn't support
|
---|
14 | * the `Proxy` class. For this reason an error must be thrown.
|
---|
15 | */
|
---|
16 | export function createProxy(handler) {
|
---|
17 | const g = global;
|
---|
18 | if (!g.Proxy) {
|
---|
19 | throw new Error('Proxy is not supported in this browser');
|
---|
20 | }
|
---|
21 | return new g.Proxy({}, handler);
|
---|
22 | }
|
---|
23 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJveHkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy9kZWJ1Zy9wcm94eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFDSCxPQUFPLEVBQUMsTUFBTSxFQUFDLE1BQU0sZ0JBQWdCLENBQUM7QUFTdEM7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLFdBQVcsQ0FBQyxPQUEwQjtJQUNwRCxNQUFNLENBQUMsR0FBRyxNQUFnQyxDQUFDO0lBQzNDLElBQUksQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFO1FBQ1osTUFBTSxJQUFJLEtBQUssQ0FBQyx3Q0FBd0MsQ0FBQyxDQUFDO0tBQzNEO0lBQ0QsT0FBTyxJQUFJL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