Skip to content

Commit d3d16f2

Browse files
committed
Remove unnecessary babel transforms
1 parent 2cc660c commit d3d16f2

File tree

3 files changed

+11
-29
lines changed

3 files changed

+11
-29
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
"extends": ["eslint:recommended"],
33

44
"env": {
5-
"es6": true,
5+
"es2018": true,
66
"node": true
77
},
88

scripts/babel-plugins.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1 @@
1-
module.exports = [
2-
'@babel/plugin-transform-arrow-functions',
3-
'@babel/plugin-transform-block-scoped-functions',
4-
'@babel/plugin-transform-block-scoping',
5-
'@babel/plugin-transform-classes',
6-
'@babel/plugin-transform-computed-properties',
7-
'@babel/plugin-transform-destructuring',
8-
'@babel/plugin-transform-duplicate-keys',
9-
'@babel/plugin-transform-for-of',
10-
'@babel/plugin-transform-literals',
11-
'@babel/plugin-transform-modules-commonjs',
12-
'@babel/plugin-transform-parameters',
13-
'@babel/plugin-transform-shorthand-properties',
14-
'@babel/plugin-transform-spread',
15-
'@babel/plugin-transform-template-literals',
16-
];
1+
module.exports = ['@babel/plugin-transform-modules-commonjs'];

src/Observable.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// === Symbol Support ===
22

3-
const hasSymbols = () => typeof Symbol === 'function';
4-
const hasSymbol = name => hasSymbols() && Boolean(Symbol[name]);
3+
const hasSymbol = name => Boolean(Symbol[name]);
54
const getSymbol = name => hasSymbol(name) ? Symbol[name] : '@@' + name;
65

7-
if (hasSymbols() && !hasSymbol('observable') && Object.isExtensible(Symbol)) {
6+
if (!hasSymbol('observable') && Object.isExtensible(Symbol)) {
87
Symbol.observable = Symbol('observable');
98
}
109

@@ -464,12 +463,10 @@ export class Observable {
464463

465464
}
466465

467-
if (hasSymbols()) {
468-
Object.defineProperty(Observable, Symbol('extensions'), {
469-
value: {
470-
symbol: SymbolObservable,
471-
hostReportError,
472-
},
473-
configurable: true,
474-
});
475-
}
466+
Object.defineProperty(Observable, Symbol('extensions'), {
467+
value: {
468+
symbol: SymbolObservable,
469+
hostReportError,
470+
},
471+
configurable: true,
472+
});

0 commit comments

Comments
 (0)