Skip to content

Commit

Permalink
Improve abort-on-stack-trace scriptlet
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jan 5, 2025
1 parent 551c6bc commit b617926
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/resources/scriptlets.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1174,13 +1174,15 @@ function abortOnStackTrace(
let v = owner[chain];
Object.defineProperty(owner, chain, {
get: function() {
if ( matchesStackTraceFn(needleDetails, extraArgs.log) ) {
const log = safe.logLevel > 1 ? 'all' : 'match';
if ( matchesStackTraceFn(needleDetails, log) ) {
throw new ReferenceError(getExceptionToken());
}
return v;
},
set: function(a) {
if ( matchesStackTraceFn(needleDetails, extraArgs.log) ) {
const log = safe.logLevel > 1 ? 'all' : 'match';
if ( matchesStackTraceFn(needleDetails, log) ) {
throw new ReferenceError(getExceptionToken());
}
v = a;
Expand Down

0 comments on commit b617926

Please sign in to comment.