Skip to content

Commit

Permalink
修复 document、windows Object.defineProperty 定义的属性 can't redefine non-co…
Browse files Browse the repository at this point in the history
…nfigurable property BUG
  • Loading branch information
yong.teng committed Jan 7, 2022
1 parent 90722b4 commit f341b15
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志

## v1.1.2

- 🐞 【修复】document、windows Object.defineProperty 定义的属性 can't redefine non-configurable property BUG


## v1.1.1

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@buession/prototype",
"alias": "prototype",
"version": "v1.1.1",
"version": "v1.1.2",
"description": "A native object extension framework for Javascript.",
"homepage": "https://buession.github.io/buession-prototype/",
"author": {
Expand All @@ -17,8 +17,8 @@
"bugs": "https://github.com/buession/buession-prototype/issues",
"private": false,
"scripts": {
"build": "npm cache clean --force && rm -fR ./dist/* && rm -fR types && rollup -c ./rollup.config.js && mv ./dist/types ./",
"lint": "eslint -c ./.eslintrc.js './{src,scripts,build}/**/*.{js,ts,tsx}'",
"build": "npm cache clean --force && rm -fR ./dist && rm -fR ./types && rollup -c ./rollup.config.js && mv ./dist/types ./",
"lint": "eslint -c ./.eslintrc.js './{src}/**/*.{js,ts,jsx,tsx}'",
"codecov": "codecov",
"release": "yarn build && yarn publish --access public"
},
Expand Down
3 changes: 3 additions & 0 deletions src/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ Object.defineProperty(document, "fullScreen", {

return false;
},
configurable: true,
writable: false
});

Expand Down Expand Up @@ -236,6 +237,7 @@ Object.defineProperty(document, "fullScreenEnabled", {

return false;
},
configurable: true,
writable: false
});

Expand Down Expand Up @@ -264,6 +266,7 @@ Object.defineProperty(document, "fullScreenElement", {

return null;
},
configurable: true,
writable: false
});

Expand Down
1 change: 1 addition & 0 deletions src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Object.defineProperty(window, "browser", {
isSafari: navigator.userAgent.exists("Safari"),
isNetscape: /Netscape([\d]*)\/([^\s]+)/i.test(navigator.userAgent)
},
configurable: true,
writable: false
});

Expand Down

0 comments on commit f341b15

Please sign in to comment.