Skip to content

Commit

Permalink
fix: Remove Symbol, Array.from polyfill. (issue #325, #275)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maizify committed Dec 25, 2020
1 parent 7a1e9f0 commit fb5e825
Show file tree
Hide file tree
Showing 7 changed files with 2,750 additions and 2,666 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ English | [简体中文](./CHANGELOG_CN.md)
- [FIX] Prevent dispatchEvent for disabled or readOnly elements. (by @norux)
- [FIX] Fix nonce searching problem. (by @sunderls)
- [FIX] Fix security issues. (#345 by @QiAnXinCodeSafe)
- [FIX] Prevent "webkitStorageInfo deprecation" warning.
- [FIX] Remove `Symbol`, `Array.from` polyfill. (issue #325, #275)
- [IMPROVE] Update Webpack DevServer option. (by @QinZhen001)

#### V3.3.4 (2019-08-19)
Expand Down
4 changes: 2 additions & 2 deletions dist/vconsole.min.js

Large diffs are not rendered by default.

5,337 changes: 2,723 additions & 2,614 deletions package-lock.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vconsole",
"version": "3.3.4",
"version": "3.4.0-alpha",
"description": "A lightweight, extendable front-end developer tool for mobile web page.",
"homepage": "https://github.com/Tencent/vConsole",
"main": "dist/vconsole.min.js",
Expand All @@ -24,26 +24,26 @@
"transitionEnd": "^1.0.2"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-export-namespace-from": "^7.5.2",
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"babel-loader": "^8.0.6",
"babel-plugin-add-module-exports": "^1.0.2",
"@babel/core": "^7.12.10",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-export-namespace-from": "^7.12.1",
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
"@babel/preset-env": "^7.12.11",
"babel-loader": "^8.2.2",
"babel-plugin-add-module-exports": "^1.0.4",
"chai": "^4.2.0",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.2.0",
"copy-webpack-plugin": "^5.1.2",
"css-loader": "^3.6.0",
"html-loader": "^0.5.5",
"jsdom": "^15.1.1",
"jsdom": "^15.2.1",
"json-loader": "^0.5.7",
"less": "^3.10.3",
"less": "^3.13.1",
"less-loader": "^5.0.0",
"mocha": "^5.2.0",
"style-loader": "^1.0.0",
"webpack": "^4.41.0",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.10.1",
"style-loader": "^1.3.0",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2"
},
"author": "Tencent",
Expand Down
16 changes: 7 additions & 9 deletions src/lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@ import render from '../lib/mito.js';

const $ = {};

if (!Array.from) {
Array.from = function(collection) {
const arr = [];
const ArrayFrom = function(collection) {
const arr = [];

for (let i = 0; i < collection.length; i++) {
arr.push(collection[i]);
}

return arr;
for (let i = 0; i < collection.length; i++) {
arr.push(collection[i]);
}

return arr;
}

/**
Expand All @@ -49,7 +47,7 @@ $.one = function(selector, contextElement) {
$.all = function(selector, contextElement) {
try {
const nodeList = (contextElement || document).querySelectorAll(selector);
return Array.from(nodeList);
return ArrayFrom(nodeList);
} catch (e) {
return [];
}
Expand Down
22 changes: 0 additions & 22 deletions src/lib/symbol.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/vconsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ Unless required by applicable law or agreed to in writing, software distributed
* A Front-End Console Panel for Mobile Webpage
*/

// global
import './lib/symbol.js';

// classes
import VConsole from './core/core.js';

Expand Down

0 comments on commit fb5e825

Please sign in to comment.