How to use ES2015 Proxy in Meteor?

Since Meteor 1.2 ES2015 is supported by default for any .js file in the Meteor project. This is great, but when I try to use the proxy name, for example

const p = new Proxy(obj1, obj2);

it gives the proxy server name undefined.

I know that ES6 is supported as all other functions (including Promises) work. So what am I doing wrong?

+4
source share
2 answers

Just figured it out. Meteor uses the Babel transpiler, which does not support Proxies, because it is not possible to polyfill with ES5.

+4
source

Have you added the ecmascript package to your project?

meteor add ecmascript

It is not native to 1.2; you still need to add it to your project.

0

Source: https://habr.com/ru/post/1619883/


All Articles