destus,
windows 10
Цитата:
|
TypeError: can't redefine non-configurable property "x"
|
-- Mozilla Firefox
Цитата:
|
Uncaught TypeError: Cannot redefine property: x
at Function.defineProperty (<anonymous>)
|
-- Google Chrome
создал страницу для теста
<!DOCTYPE html>
<html>
<head>
<script>
var x = 3;
Object.defineProperty(window, "x", {
get : function(){
return this._x;
},
set : function(value){
this._x = value;
if (value == 5) {
console.log("x == 5");
}
}
});
x = 5;
</script>
</head>
<body>
</body>
</html>
запускаю в браузерах, ошибки выдаёт.
вчера эти же ошибки были тут пост 2, на форуме, сегодня их нет, когда запускаешь код.