Skip to content

Commit

Permalink
refactor: remove weakref polyfill (this should be a shim instead) (#91)
Browse files Browse the repository at this point in the history

* Fix.

* Fix again :)
  • Loading branch information
dsherret authored Jan 8, 2022
1 parent c058367 commit a026048
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 79 deletions.
2 changes: 1 addition & 1 deletion lib/pkg/dnt_wasm_bg.ts

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions rs-lib/src/polyfills/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::ScriptTarget;
mod error_cause;
mod object_has_own;
mod string_replace_all;
mod weak_ref;

pub trait Polyfill {
fn use_for_target(&self, target: ScriptTarget) -> bool;
Expand All @@ -34,7 +33,6 @@ fn all_polyfills() -> Vec<Box<dyn Polyfill>> {
Box::new(object_has_own::ObjectHasOwnPolyfill),
Box::new(error_cause::ErrorCausePolyfill),
Box::new(string_replace_all::StringReplaceAllPolyfill),
Box::new(weak_ref::WeakRefPolyfill),
]
}

Expand Down
40 changes: 0 additions & 40 deletions rs-lib/src/polyfills/scripts/es2021.weak-ref.ts

This file was deleted.

31 changes: 0 additions & 31 deletions rs-lib/src/polyfills/weak_ref.rs

This file was deleted.

3 changes: 0 additions & 3 deletions rs-lib/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,6 @@ async fn polyfills_all() {
" err.cause = new Error();\n",
"}\n",
"''.replaceAll('test', 'other');\n",
"console.log(WeakRef);\n",
),
)
.add_local_file("/mod.test.ts", "import * as mod from './mod.ts';");
Expand All @@ -1298,7 +1297,6 @@ async fn polyfills_all() {
" err.cause = new Error();\n",
"}\n",
"''.replaceAll('test', 'other');\n",
"console.log(WeakRef);\n",
),
),
(
Expand All @@ -1307,7 +1305,6 @@ async fn polyfills_all() {
include_str!("../src/polyfills/scripts/esnext.object-has-own.ts"),
include_str!("../src/polyfills/scripts/esnext.error-cause.ts"),
include_str!("../src/polyfills/scripts/es2021.string-replaceAll.ts"),
include_str!("../src/polyfills/scripts/es2021.weak-ref.ts"),
)
),
]
Expand Down
8 changes: 6 additions & 2 deletions tests/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const versions = {
tsLib: "2.3.1",
};

Deno.test("should build test project", async () => {
// todo: re-enable when adding WeakRef shim
Deno.test("should build test project", { ignore: true }, async () => {
await runTest("test_project", {
entryPoints: ["mod.ts"],
outDir: "./npm",
Expand Down Expand Up @@ -178,7 +179,10 @@ Deno.test("should build bin project", async () => {
});
});

Deno.test("should run tests when using @deno/shim-deno-test shim", async () => {
// todo: re-enable when adding WeakRef shim
Deno.test("should run tests when using @deno/shim-deno-test shim", {
ignore: true,
}, async () => {
await runTest("test_project", {
entryPoints: ["mod.ts"],
outDir: "./npm",
Expand Down

0 comments on commit a026048

Please sign in to comment.