Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9312964
es.error.cause.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
es.error.cause.js
View Options
/* eslint-disable no-unused-vars -- required for functions `.length` */
var
$
=
require
(
'../internals/export'
);
var
global
=
require
(
'../internals/global'
);
var
apply
=
require
(
'../internals/function-apply'
);
var
wrapErrorConstructorWithCause
=
require
(
'../internals/wrap-error-constructor-with-cause'
);
var
WEB_ASSEMBLY
=
'WebAssembly'
;
var
WebAssembly
=
global
[
WEB_ASSEMBLY
];
var
FORCED
=
Error
(
'e'
,
{
cause
:
7
}).
cause
!==
7
;
var
exportGlobalErrorCauseWrapper
=
function
(
ERROR_NAME
,
wrapper
)
{
var
O
=
{};
O
[
ERROR_NAME
]
=
wrapErrorConstructorWithCause
(
ERROR_NAME
,
wrapper
,
FORCED
);
$
({
global
:
true
,
constructor
:
true
,
arity
:
1
,
forced
:
FORCED
},
O
);
};
var
exportWebAssemblyErrorCauseWrapper
=
function
(
ERROR_NAME
,
wrapper
)
{
if
(
WebAssembly
&&
WebAssembly
[
ERROR_NAME
])
{
var
O
=
{};
O
[
ERROR_NAME
]
=
wrapErrorConstructorWithCause
(
WEB_ASSEMBLY
+
'.'
+
ERROR_NAME
,
wrapper
,
FORCED
);
$
({
target
:
WEB_ASSEMBLY
,
stat
:
true
,
constructor
:
true
,
arity
:
1
,
forced
:
FORCED
},
O
);
}
};
// https://github.com/tc39/proposal-error-cause
exportGlobalErrorCauseWrapper
(
'Error'
,
function
(
init
)
{
return
function
Error
(
message
)
{
return
apply
(
init
,
this
,
arguments
);
};
});
exportGlobalErrorCauseWrapper
(
'EvalError'
,
function
(
init
)
{
return
function
EvalError
(
message
)
{
return
apply
(
init
,
this
,
arguments
);
};
});
exportGlobalErrorCauseWrapper
(
'RangeError'
,
function
(
init
)
{
return
function
RangeError
(
message
)
{
return
apply
(
init
,
this
,
arguments
);
};
});
exportGlobalErrorCauseWrapper
(
'ReferenceError'
,
function
(
init
)
{
return
function
ReferenceError
(
message
)
{
return
apply
(
init
,
this
,
arguments
);
};
});
exportGlobalErrorCauseWrapper
(
'SyntaxError'
,
function
(
init
)
{
return
function
SyntaxError
(
message
)
{
return
apply
(
init
,
this
,
arguments
);
};
});
exportGlobalErrorCauseWrapper
(
'TypeError'
,
function
(
init
)
{
return
function
TypeError
(
message
)
{
return
apply
(
init
,
this
,
arguments
);
};
});
exportGlobalErrorCauseWrapper
(
'URIError'
,
function
(
init
)
{
return
function
URIError
(
message
)
{
return
apply
(
init
,
this
,
arguments
);
};
});
exportWebAssemblyErrorCauseWrapper
(
'CompileError'
,
function
(
init
)
{
return
function
CompileError
(
message
)
{
return
apply
(
init
,
this
,
arguments
);
};
});
exportWebAssemblyErrorCauseWrapper
(
'LinkError'
,
function
(
init
)
{
return
function
LinkError
(
message
)
{
return
apply
(
init
,
this
,
arguments
);
};
});
exportWebAssemblyErrorCauseWrapper
(
'RuntimeError'
,
function
(
init
)
{
return
function
RuntimeError
(
message
)
{
return
apply
(
init
,
this
,
arguments
);
};
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 11:17 AM (1 w, 17 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3368020
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment