0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

webapi: Rename misspelled inheritence to inheritance (#5634)

This commit is contained in:
Anders Kaseorg 2022-12-18 19:26:48 -08:00 committed by GitHub
parent 7f7450e673
commit 4d4883e816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -205,8 +205,8 @@ async function build() {
await rm('lib', { force: true, recursive: true }) await rm('lib', { force: true, recursive: true })
await rm('exclusions.d.ts', { force: true, recursive: true }) await rm('exclusions.d.ts', { force: true, recursive: true })
await rm('exclusions.d.ts.map', { force: true, recursive: true }) await rm('exclusions.d.ts.map', { force: true, recursive: true })
await rm('inheritence.d.ts', { force: true, recursive: true }) await rm('inheritance.d.ts', { force: true, recursive: true })
await rm('inheritence.d.ts.map', { force: true, recursive: true }) await rm('inheritance.d.ts.map', { force: true, recursive: true })
await rm('polyfill.d.ts.map', { force: true, recursive: true }) await rm('polyfill.d.ts.map', { force: true, recursive: true })
await rm('polyfill.js.map', { force: true, recursive: true }) await rm('polyfill.js.map', { force: true, recursive: true })
await rm('polyfill.js', { force: true, recursive: true }) await rm('polyfill.js', { force: true, recursive: true })

View file

@ -1,4 +1,4 @@
export const inheritence = { export const inheritance = {
CSSStyleSheet: 'StyleSheet', CSSStyleSheet: 'StyleSheet',
CustomEvent: 'Event', CustomEvent: 'Event',
DOMException: 'Error', DOMException: 'Error',

View file

@ -83,7 +83,7 @@ import {
} from './ponyfill' } from './ponyfill'
import { exclusions } from './exclusions' import { exclusions } from './exclusions'
import { inheritence } from './inheritence' import { inheritance } from './inheritance'
export { pathToPosix } from './lib/utils' export { pathToPosix } from './lib/utils'
export { export {
@ -288,10 +288,10 @@ export const polyfill = (target: any, options?: PolyfillOptions) => {
if (excludeOptions.has(name)) continue if (excludeOptions.has(name)) continue
// skip WebAPIs that do not extend other WebAPIs // skip WebAPIs that do not extend other WebAPIs
if (!Object.hasOwnProperty.call(inheritence, name)) continue if (!Object.hasOwnProperty.call(inheritance, name)) continue
const Class = target[name] const Class = target[name]
const Super = target[inheritence[name as keyof typeof inheritence]] const Super = target[inheritance[name as keyof typeof inheritance]]
// skip WebAPIs that are not available // skip WebAPIs that are not available
if (!Class || !Super) continue if (!Class || !Super) continue
@ -299,7 +299,7 @@ export const polyfill = (target: any, options?: PolyfillOptions) => {
// skip WebAPIs that are already inherited correctly // skip WebAPIs that are already inherited correctly
if (Object.getPrototypeOf(Class.prototype) === Super.prototype) continue if (Object.getPrototypeOf(Class.prototype) === Super.prototype) continue
// define WebAPIs inheritence // define WebAPIs inheritance
Object.setPrototypeOf(Class.prototype, Super.prototype) Object.setPrototypeOf(Class.prototype, Super.prototype)
} }