ecmascript-5

Why does copying eval change its behaviour?

喜你入骨 提交于 2020-06-16 03:35:14
问题 According to the rollupjs documentation: Simply 'copying' eval provides you with a function that does exactly the same thing, but which runs in the global scope rather than the local one: var eval2 = eval; (function () { var foo = 42; eval('console.log("with eval:",foo)'); // logs 'with eval: 42' eval2('console.log("with eval2:",foo)'); // throws ReferenceError })(); Can anyone explain exactly how this works? I haven't been able to find anything specific about eval() in the ECMAScript spec.

Window.open url rewrites the base url two times [closed]

旧城冷巷雨未停 提交于 2020-06-09 07:10:20
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 days ago . Uder my Angular app ; i m formating an url to open it in a new window : example : myURL = `http://www.mywebsite.fr/BB/196?VARIABLEONE=2632&VARIABLETWO=FFHJK&VARIABLETHREE=TEST/` when using it : window.open(myURL) ; it doesn't open me that yurl , but i's opening this one : https://www.mywebsite.fr/