Skip to content

Commit 5041fbf

Browse files
iamstoliswoess
authored andcommitted
Enabling Error.stackTraceLimit in MLE mode.
(cherry picked from commit f0f3dc6)
1 parent fa68370 commit 5041fbf

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/nodes/access/ErrorStackTraceLimitNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected final int doInt(
7070
@Cached IsNumberNode isNumber,
7171
@Cached JSToIntegerAsLongNode toInteger) {
7272
JSContext context = getJSContext();
73-
if (context.isOptionV8CompatibilityMode()) {
73+
if (context.isOptionV8CompatibilityMode() || context.getLanguageOptions().isMLEMode()) {
7474
JSFunctionObject errorConstructor = getRealm().getErrorConstructor(JSErrorType.Error);
7575
if (JSProperty.isData(getStackTraceLimit.getPropertyFlagsOrDefault(errorConstructor, JSError.STACK_TRACE_LIMIT_PROPERTY_NAME, JSProperty.ACCESSOR))) {
7676
Object value = getStackTraceLimit.getOrDefault(errorConstructor, JSError.STACK_TRACE_LIMIT_PROPERTY_NAME, Undefined.instance);

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/JSException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public static JSException create(JSErrorType type, String message, Throwable cau
151151

152152
public static int getStackTraceLimit(JSRealm realm) {
153153
JSContextOptions contextOptions = realm.getContextOptions();
154-
if (contextOptions.isV8CompatibilityMode()) {
154+
if (contextOptions.isV8CompatibilityMode() || contextOptions.isMLEMode()) {
155155
JSFunctionObject errorConstructor = realm.getErrorConstructor(JSErrorType.Error);
156156
DynamicObjectLibrary lib = DynamicObjectLibrary.getUncached();
157157
if (JSProperty.isData(lib.getPropertyFlagsOrDefault(errorConstructor, JSError.STACK_TRACE_LIMIT_PROPERTY_NAME, JSProperty.ACCESSOR))) {

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/JSRealm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2253,7 +2253,7 @@ private void addGlobalGlobal() {
22532253
}
22542254

22552255
private void addErrorStackTraceLimit() {
2256-
if (getContextOptions().isV8CompatibilityMode()) {
2256+
if (getContextOptions().isV8CompatibilityMode() || getContextOptions().isMLEMode()) {
22572257
JSObject errorConstructor = getErrorConstructor(JSErrorType.Error);
22582258
JSObjectUtil.putDataProperty(errorConstructor, JSError.STACK_TRACE_LIMIT_PROPERTY_NAME, getContextOptions().getStackTraceLimit(), JSAttributes.getDefault());
22592259
}

0 commit comments

Comments
 (0)