Skip to content

Commit fbaab99

Browse files
PanayotCankovPlamen5kov
authored andcommitted
feat(typescript): Play nice with tslib (#895)
AngularApp started adding tslib in the web pack project. This PR will set the __native, __extends and __decorate on the global using Object.defineProperty, so the tslib won't be able to overwrite them. Ideally adding tslib to a project should bring support for async/await etc.
1 parent e079cd6 commit fbaab99

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test-app/app/src/main/assets/internal/ts_helpers.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,10 @@
119119
}
120120
}
121121

122-
global.__native = __native;
123-
global.__extends = __extends;
124-
global.__decorate = __decorate;
122+
Object.defineProperty(global, "__native", { value: __native });
123+
Object.defineProperty(global, "__extends", { value: __extends });
124+
Object.defineProperty(global, "__decorate", { value: __decorate });
125+
125126
global.JavaProxy = JavaProxy;
126127
global.Interfaces = Interfaces;
127-
})()
128+
})()

0 commit comments

Comments
 (0)