Skip to content

Commit

Permalink
feat(polyfill): adds a 'proto' polyfill that adds support for '__prot…
Browse files Browse the repository at this point in the history
…o__' on IE <11
  • Loading branch information
wessberg committed Apr 6, 2019
1 parent 6c66053 commit 41ba4c2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 16 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -732,3 +732,4 @@ And, if you request `performance.now`, `date.now` will also be included since th
- `intersection-observer`
- `mutation-observer`
- `resize-observer`
- `proto`
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
"pretty-quick": "^1.10.0",
"standard-changelog": "^2.0.7",
"ts-node": "^8.0.3",
"tslint": "^5.14.0",
"typescript": "^3.4.1",
"tslint": "^5.15.0",
"typescript": "^3.4.2",
"useragent-generator": "^1.1.1-amkt-22079-finish.0"
},
"dependencies": {
"@babel/core": "^7.4.0",
"@babel/core": "^7.4.3",
"@babel/plugin-transform-block-scoping": "^7.4.0",
"@types/astring": "^1.3.0",
"@types/file-type": "^10.9.1",
Expand All @@ -84,9 +84,9 @@
"blob-polyfill": "^3.0.20180112",
"chalk": "^2.4.2",
"console-polyfill": "^0.3.0",
"construct-style-sheets-polyfill": "^1.0.2",
"core-js": "^3.0.0",
"core-js-builder": "^3.0.0",
"construct-style-sheets-polyfill": "^1.0.3",
"core-js": "^3.0.1",
"core-js-builder": "^3.0.1",
"devcert": "^1.0.0",
"events-polyfill": "^2.1.0",
"file-type": "^10.10.0",
Expand All @@ -98,7 +98,7 @@
"intl-list-format": "^1.0.2",
"intl-relative-time-format": "^1.0.6",
"memory-fs": "^0.4.1",
"mime": "^2.4.0",
"mime": "^2.4.1",
"mutationobserver-shim": "^0.3.3",
"node.parentelement": "^1.0.2",
"nodemon": "^1.18.10",
Expand All @@ -109,10 +109,10 @@
"regenerator-runtime": "^0.13.2",
"requestanimationframe": "0.0.23",
"requestidlecallback": "^0.3.0",
"rollup": "^1.7.4",
"rollup-plugin-commonjs": "^9.2.2",
"rollup": "^1.9.0",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-multi-entry": "^2.1.0",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-node-resolve": "^4.2.1",
"scroll-behavior-polyfill": "^2.0.7",
"semver": "^6.0.0",
"setimmediate": "^1.0.5",
Expand All @@ -124,7 +124,8 @@
"web-animations-js": "^2.3.1",
"whatwg-fetch": "^3.0.0",
"xhr-polyfill": "^0.1.8",
"zone.js": "^0.9.0"
"zone.js": "^0.9.0",
"proto-polyfill": "^1.7.0"
},
"main": "./dist/index.js",
"module": "./dist/index.js",
Expand Down
16 changes: 12 additions & 4 deletions src/constant/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export const constant: IConstant = {
relativePaths: ["modules/es.object.get-prototype-of.js"],
features: ["javascript.builtins.Object.getPrototypeOf"],
version: environment.NPM_PACKAGE_DEPENDENCIES_CORE_JS,
dependencies: [],
dependencies: ["proto"],
contexts: ALL_CONTEXTS
},
"es.object.is-extensible": {
Expand Down Expand Up @@ -424,7 +424,7 @@ export const constant: IConstant = {
relativePaths: ["modules/es.object.set-prototype-of.js"],
features: ["javascript.builtins.Object.setPrototypeOf"],
version: environment.NPM_PACKAGE_DEPENDENCIES_CORE_JS,
dependencies: [],
dependencies: ["proto"],
contexts: ALL_CONTEXTS
},
"es.object.to-string": {
Expand Down Expand Up @@ -2487,7 +2487,7 @@ export const constant: IConstant = {
relativePaths: ["modules/es.reflect.get-prototype-of.js"],
features: ["javascript.builtins.Reflect.getPrototypeOf"],
version: environment.NPM_PACKAGE_DEPENDENCIES_CORE_JS,
dependencies: [],
dependencies: ["proto"],
contexts: ALL_CONTEXTS
},
"es.reflect.has": {
Expand Down Expand Up @@ -2535,7 +2535,7 @@ export const constant: IConstant = {
relativePaths: ["modules/es.reflect.set-prototype-of.js"],
features: ["javascript.builtins.Reflect.setPrototypeOf"],
version: environment.NPM_PACKAGE_DEPENDENCIES_CORE_JS,
dependencies: [],
dependencies: ["proto"],
contexts: ALL_CONTEXTS
},
esnext: {
Expand Down Expand Up @@ -2990,6 +2990,14 @@ export const constant: IConstant = {
version: environment.NPM_PACKAGE_DEPENDENCIES_CONSTRUCT_STYLE_SHEETS_POLYFILL,
dependencies: ["shadow-dom"],
contexts: ALL_CONTEXTS
},
proto: {
library: "proto-polyfill",
relativePaths: ["index.js"],
features: ["javascript.builtins.Object.proto"],
version: environment.NPM_PACKAGE_DEPENDENCIES_PROTO_POLYFILL,
dependencies: [],
contexts: ALL_CONTEXTS
}
}
};
1 change: 1 addition & 0 deletions src/environment/environment-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const environmentDefaults = {
NPM_PACKAGE_MAIN: "",
NPM_PACKAGE_DEPENDENCIES_INTERSECTION_OBSERVER: "",
NPM_PACKAGE_DEPENDENCIES_CONSTRUCT_STYLE_SHEETS_POLYFILL: "",
NPM_PACKAGE_DEPENDENCIES_PROTO_POLYFILL: "",
NPM_PACKAGE_DEPENDENCIES_SCROLL_BEHAVIOR_POLYFILL: "",
NPM_PACKAGE_DEPENDENCIES_SETIMMEDIATE: "",
NPM_PACKAGE_DEPENDENCIES_WHATWG_FETCH: "",
Expand Down
3 changes: 2 additions & 1 deletion src/polyfill/polyfill-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,5 @@ export declare type PolyfillDealiasedName =
| "set-immediate"
| "web-animations"
| "global-this"
| "constructable-style-sheets";
| "constructable-style-sheets"
| "proto";

0 comments on commit 41ba4c2

Please sign in to comment.