Skip to content

Commit 221e047

Browse files
build(dev): ignore removing private fields (#1157)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 68d1c8e commit 221e047

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

packages/dev/scripts/polkadot-dev-build-ts.mjs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,7 @@ async function compileJs (compileType, type) {
7171
// split src prefix, replace .ts extension with .js
7272
const outFile = path.join(buildDir, filename.split(/[\\/]/).slice(1).join('/').replace(/\.tsx?$/, '.js'));
7373

74-
// Until we hit the es2022 target, all private fields are compiled to using
75-
// WeakMap with less than stellar performannce of get/set on the polyfill. We
76-
// replace usages of these with TS-only private fields.
77-
//
78-
// As used these are internal-only, completely hidden fields should be done via
79-
// closures, see e.g. the common keypairs where this is done
80-
const source = fs
81-
.readFileSync(filename, 'utf-8')
82-
.replace(/(this|other|source)\.#/g, '$1.__internal__')
83-
.replace(/ {2}(async|readonly) #/g, ' private $1 __internal__')
84-
.replace(/ {2}#/g, ' private __internal__');
74+
const source = fs.readFileSync(filename, 'utf-8');
8575

8676
// compile with the options aligning with our tsconfig
8777
const { outputText } = ts.transpileModule(source, {

0 commit comments

Comments
 (0)