From f341b1500edac8b8640839f72784c47bd9d2bb23 Mon Sep 17 00:00:00 2001 From: "yong.teng" Date: Fri, 7 Jan 2022 12:43:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20document=E3=80=81windows?= =?UTF-8?q?=20Object.defineProperty=20=E5=AE=9A=E4=B9=89=E7=9A=84=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=20can't=20redefine=20non-configurable=20property=20BU?= =?UTF-8?q?G?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ package.json | 6 +++--- src/document.ts | 3 +++ src/window.ts | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27c227d..c836677 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # 更新日志 +## v1.1.2 + +- 🐞 【修复】document、windows Object.defineProperty 定义的属性 can't redefine non-configurable property BUG + ## v1.1.1 diff --git a/package.json b/package.json index 3e4a91f..37a943d 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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" }, diff --git a/src/document.ts b/src/document.ts index 46cd7a0..b28480b 100644 --- a/src/document.ts +++ b/src/document.ts @@ -208,6 +208,7 @@ Object.defineProperty(document, "fullScreen", { return false; }, + configurable: true, writable: false }); @@ -236,6 +237,7 @@ Object.defineProperty(document, "fullScreenEnabled", { return false; }, + configurable: true, writable: false }); @@ -264,6 +266,7 @@ Object.defineProperty(document, "fullScreenElement", { return null; }, + configurable: true, writable: false }); diff --git a/src/window.ts b/src/window.ts index 14eed7e..83e58cd 100644 --- a/src/window.ts +++ b/src/window.ts @@ -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 });