Skip to content

Commit

Permalink
Remove unnecessary babel transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
zenparsing committed Oct 28, 2022
1 parent 2cc660c commit d3d16f2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
"extends": ["eslint:recommended"],

"env": {
"es6": true,
"es2018": true,
"node": true
},

Expand Down
17 changes: 1 addition & 16 deletions scripts/babel-plugins.js
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
module.exports = [
'@babel/plugin-transform-arrow-functions',
'@babel/plugin-transform-block-scoped-functions',
'@babel/plugin-transform-block-scoping',
'@babel/plugin-transform-classes',
'@babel/plugin-transform-computed-properties',
'@babel/plugin-transform-destructuring',
'@babel/plugin-transform-duplicate-keys',
'@babel/plugin-transform-for-of',
'@babel/plugin-transform-literals',
'@babel/plugin-transform-modules-commonjs',
'@babel/plugin-transform-parameters',
'@babel/plugin-transform-shorthand-properties',
'@babel/plugin-transform-spread',
'@babel/plugin-transform-template-literals',
];
module.exports = ['@babel/plugin-transform-modules-commonjs'];
21 changes: 9 additions & 12 deletions src/Observable.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// === Symbol Support ===

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

if (hasSymbols() && !hasSymbol('observable') && Object.isExtensible(Symbol)) {
if (!hasSymbol('observable') && Object.isExtensible(Symbol)) {
Symbol.observable = Symbol('observable');
}

Expand Down Expand Up @@ -464,12 +463,10 @@ export class Observable {

}

if (hasSymbols()) {
Object.defineProperty(Observable, Symbol('extensions'), {
value: {
symbol: SymbolObservable,
hostReportError,
},
configurable: true,
});
}
Object.defineProperty(Observable, Symbol('extensions'), {
value: {
symbol: SymbolObservable,
hostReportError,
},
configurable: true,
});

0 comments on commit d3d16f2

Please sign in to comment.