fix(core): correctly polyfill tslib

This commit is contained in:
Eduardo Speroni
2022-05-04 12:46:21 -03:00
parent eb4c4a3091
commit 5bed6c53da
2 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import * as tslibType from 'tslib'; import type * as tslibType from 'tslib';
const tslib: typeof tslibType = require('tslib'); const tslib: typeof tslibType = require('tslib');
import { Observable } from '../data/observable'; import { Observable } from '../data/observable';
import { trace as profilingTrace, time, uptime, level as profilingLevel } from '../profiling'; import { trace as profilingTrace, time, uptime, level as profilingLevel } from '../profiling';
@ -132,7 +132,7 @@ export function initGlobal() {
// Bind the tslib helpers to global scope. // Bind the tslib helpers to global scope.
// This is needed when we don't use importHelpers, which // This is needed when we don't use importHelpers, which
// breaks extending native-classes // breaks extending native-classes
for (const fnName of Object.keys(tslib)) { for (const fnName of Object.getOwnPropertyNames(tslib)) {
if (typeof tslib[fnName] !== 'function') { if (typeof tslib[fnName] !== 'function') {
continue; continue;
} }

View File

@ -46,7 +46,7 @@
"acorn": "^8.7.0", "acorn": "^8.7.0",
"css-tree": "^1.1.2", "css-tree": "^1.1.2",
"reduce-css-calc": "^2.1.7", "reduce-css-calc": "^2.1.7",
"tslib": "~2.0.0" "tslib": "^2.0.0"
}, },
"nativescript": { "nativescript": {
"platforms": { "platforms": {