File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -346,7 +346,9 @@ for (const argument of process.argv.slice(2)) {
346346 if ( ! minify && mangleNames )
347347 console . warn ( `warning: \`--mangle-names\` has no effect while \`--skip-minify\` is active` )
348348
349- const { script, srcLength, warnings, timeTook } = await processScript (
349+ const timeStart = performance . now ( )
350+
351+ const { script, srcLength, warnings } = await processScript (
350352 source ,
351353 {
352354 minify,
@@ -357,6 +359,8 @@ for (const argument of process.argv.slice(2)) {
357359 }
358360 )
359361
362+ const timeTook = performance . now ( ) - timeStart
363+
360364 for ( const { message, line } of warnings )
361365 console . log ( `warning "${ chalk . bold ( message ) } " on line ${ chalk . bold ( String ( line ) ) } ` )
362366
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ import rollupPluginJSON from "@rollup/plugin-json"
2828import rollupPluginNodeResolve from "@rollup/plugin-node-resolve"
2929import { assert , countHackmudCharacters } from "@samual/lib"
3030import { resolve as resolvePath } from "path"
31- import { performance } from "perf_hooks"
3231import prettier from "prettier"
3332import { rollup } from "rollup"
3433import { supportedExtensions as extensions } from "../constants.json"
@@ -87,11 +86,9 @@ export async function processScript(
8786 srcLength : number
8887 script : string
8988 warnings : { message : string , line : number } [ ]
90- timeTook : number
9189} > {
9290 assert ( / ^ \w { 11 } $ / . exec ( uniqueID ) )
9391
94- const time = performance . now ( )
9592 const sourceCode = code
9693 let autocomplete
9794 let statedSeclevel
@@ -337,13 +334,10 @@ export async function processScript(
337334 if ( includesIllegalString ( code ) )
338335 throw new Error ( `you found a weird edge case where I wasn't able to replace illegal strings like "SC$", please report thx` )
339336
340- // TODO it is not neccesary to record the time took since the caller can do that
341-
342337 return {
343338 srcLength : sourceLength ,
344339 script : code ,
345- warnings : [ ] ,
346- timeTook : performance . now ( ) - time
340+ warnings : [ ]
347341 }
348342}
349343
You can’t perform that action at this time.
0 commit comments