Skip to content

Commit

Permalink
Make chrome-launcher root package node 4 compat.
Browse files Browse the repository at this point in the history
* Fixes *
- change tsconfig to target es5
- change tsconfig to include es2015 lib polyfills
- change set iteration to use .forEach since this support is not present
  in es5
- make manual-chrome-launcher not use es2015 import syntax

REF #8
  • Loading branch information
samccone committed Dec 3, 2017
1 parent 5617473 commit cb2dcda
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions chrome-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ export interface ModuleOverrides {
}

const sigintListener = async () => {
for (const instance of instances) {
// Since sets are not iterable below es2015 we need
// too `.forEach` iterate over the set.
// https://github.com/Microsoft/TypeScript/issues/6842
instances.forEach(async (instance) => {
await instance.kill();
}
});
process.exit(_SIGINT_EXIT_CODE);
};

Expand Down
2 changes: 1 addition & 1 deletion manual-chrome-launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

require('./compiled-check.js')('chrome-launcher.js');
const {launch} = require('./chrome-launcher');
const launch = require('./chrome-launcher').launch;

const args = process.argv.slice(2);
let chromeFlags;
Expand Down
9 changes: 6 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"target": "es5",
"declaration": true,
"noImplicitAny": true,
"inlineSourceMap": true,
"noEmitOnError": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true
"noUnusedParameters": true,
"lib": [
"es2015"
]
},
"exclude": [
"node_modules"
],
"include": [
"*.ts"
]
}
}

0 comments on commit cb2dcda

Please sign in to comment.