Skip to content

Commit

Permalink
Fixed a bug with determining the presence of a native AbortController;
Browse files Browse the repository at this point in the history
Optimized build flow;
  • Loading branch information
DigitalBrainJS committed May 12, 2021
1 parent 641579f commit a5a1394
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/abort-controller.js
Expand Up @@ -2,6 +2,8 @@
* @module AbortController
*/

const {globalObject}= require('./utils');

const _signal = Symbol('signal');
const _aborted = Symbol('aborted');
const _events = Symbol('events');
Expand All @@ -10,6 +12,7 @@ const _repeatedly = Symbol('repeatedly');

const nativeAbortController= (()=>{
try {
const {AbortController}= globalObject;
if (typeof AbortController === 'function') {
const controller = new AbortController();
if (controller.toString() === '[object AbortController]' &&
Expand Down
2 changes: 1 addition & 1 deletion lib/env.js
@@ -1,4 +1,4 @@
const {version} = require('../package.json');
const {version} = require('./env.json');

const _version= Symbol.for('CPromise:version');
const _versionNumber= Symbol.for('CPromise:version:number');
Expand Down
1 change: 1 addition & 0 deletions lib/env.json
@@ -0,0 +1 @@
{"version":"0.13.2"}
3 changes: 3 additions & 0 deletions rollup.config.js
@@ -1,3 +1,4 @@
import fs from 'fs';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { terser } from "rollup-plugin-terser";
Expand All @@ -11,6 +12,8 @@ const input = './lib/c-promise.js';
const year= new Date().getFullYear();
const banner= `// ${lib.name} v${lib.version}\n// Copyright (c) ${year===2020? "2020" : "2020-"+ year} ${lib.author.name} <${lib.author.email}>`;

fs.writeFileSync('./lib/env.json', JSON.stringify({version: lib.version}))

export default [
{
input,
Expand Down

0 comments on commit a5a1394

Please sign in to comment.