Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: panic, unwrap to unwrap_or #739

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
13 changes: 13 additions & 0 deletions core/00_primordials.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,19 @@
},
);

primordials.ArrayPrototypePush = (thisArray, ...variableArgs) => {
const args = [...variableArgs];
peko-thunder marked this conversation as resolved.
Show resolved Hide resolved
for (let i = 0; i < args.length; i++) {
ObjectDefineProperty(thisArray, thisArray.length, {
peko-thunder marked this conversation as resolved.
Show resolved Hide resolved
value: args[i],
enumerable: true,
writable: true,
configurable: true,
});
}
return thisArray.length;
};

primordials.ArrayPrototypeToString = (thisArray) =>
ArrayPrototypeJoin(thisArray);

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.

// This test refers to the issue.
// https://github.com/denoland/deno_core/issues/744

Object.prototype.__defineSetter__(0, function () {});

// Need to dare to make errors.
// For example, `ReferenceError: variable is not defined`.
variable;
1 change: 1 addition & 0 deletions testing/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ integration_test!(
error_rejection_catch,
error_rejection_order,
error_ext_stack,
error_internal_method_set,
error_with_stack,
error_without_stack,
main_module_handler,
Expand Down