Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private void configureContext(Context cx) throws ScriptException {
Object ol = get(OPTIMIZATION_LEVEL);
if (ol != null) {
// Handle backwardly-compatible "optimization level".
cx.setOptimizationLevel(parseInteger(ol));
cx.impl().setOptimizationLevel(parseInteger(ol));
}
Object interpreted = get(INTERPRETED_MODE);
if (interpreted != null) {
Expand Down
30 changes: 15 additions & 15 deletions rhino/src/main/java/org/mozilla/javascript/BaseFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,15 +420,15 @@ private static Scriptable js_gen_constructorCall(
private static Scriptable js_constructor(Context cx, Scriptable scope, Object[] args) {
if (cx.isStrictMode()) {
// Disable strict mode forcefully, and restore it after the call
NativeCall activation = cx.currentActivationCall;
boolean strictMode = cx.isTopLevelStrict;
NativeCall activation = cx.impl().currentActivationCall;
boolean strictMode = cx.impl().isTopLevelStrict;
try {
cx.currentActivationCall = null;
cx.isTopLevelStrict = false;
cx.impl().currentActivationCall = null;
cx.impl().isTopLevelStrict = false;
return jsConstructor(cx, scope, args, false);
} finally {
cx.isTopLevelStrict = strictMode;
cx.currentActivationCall = activation;
cx.impl().isTopLevelStrict = strictMode;
cx.impl().currentActivationCall = activation;
}
} else {
return jsConstructor(cx, scope, args, false);
Expand All @@ -443,15 +443,15 @@ private static Scriptable js_constructorCall(
private static Scriptable js_gen_constructor(Context cx, Scriptable scope, Object[] args) {
if (cx.isStrictMode()) {
// Disable strict mode forcefully, and restore it after the call
NativeCall activation = cx.currentActivationCall;
boolean strictMode = cx.isTopLevelStrict;
NativeCall activation = cx.impl().currentActivationCall;
boolean strictMode = cx.impl().isTopLevelStrict;
try {
cx.currentActivationCall = null;
cx.isTopLevelStrict = false;
cx.impl().currentActivationCall = null;
cx.impl().isTopLevelStrict = false;
return jsConstructor(cx, scope, args, true);
} finally {
cx.isTopLevelStrict = strictMode;
cx.currentActivationCall = activation;
cx.impl().isTopLevelStrict = strictMode;
cx.impl().currentActivationCall = activation;
}
} else {
return jsConstructor(cx, scope, args, true);
Expand Down Expand Up @@ -704,7 +704,7 @@ private static Scriptable jsConstructor(
String source = sourceBuf.toString();

int[] linep = new int[1];
String filename = Context.getSourcePositionFromStack(linep);
String filename = ContextImpl.getSourcePositionFromStack(linep);
if (filename == null) {
filename = "<eval'ed string>";
linep[0] = 1;
Expand All @@ -717,14 +717,14 @@ private static Scriptable jsConstructor(
ErrorReporter reporter;
reporter = DefaultErrorReporter.forEval(cx.getErrorReporter());

Evaluator evaluator = Context.createInterpreter();
Evaluator evaluator = ContextImpl.createInterpreter();
if (evaluator == null) {
throw new JavaScriptException("Interpreter not present", filename, linep[0]);
}

// Compile with explicit interpreter instance to force interpreter
// mode.
return cx.compileFunction(global, source, evaluator, reporter, sourceURI, 1, null);
return cx.impl().compileFunction(global, source, evaluator, reporter, sourceURI, 1, null);
}

public void setHomeObject(Scriptable homeObject) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void initFromContext(Context cx) {
interpretedMode = cx.isInterpretedMode();

generatingSource = cx.isGeneratingSource();
activationNames = cx.activationNames;
activationNames = cx.impl().activationNames;

// Observer code generation in compiled code :
generateObserverCount = cx.isGenerateObserverCount();
Expand Down Expand Up @@ -116,7 +116,7 @@ public final boolean isInterpretedMode() {
@Deprecated
@SuppressWarnings("deprecation")
public void setOptimizationLevel(int level) {
Context.checkOptimizationLevel(level);
ContextImpl.checkOptimizationLevel(level);
interpretedMode = (level < 0);
}

Expand Down
Loading
Loading