Skip to content

Commit

Permalink
Use default for hermes es6 proxy enabled (#30142)
Browse files Browse the repository at this point in the history
Summary:
Proxy is now enabled by default in hermes 0.7 (https://github.com/facebook/hermes/releases/tag/v0.7.0). However we currently disable it because of the config we pass.

This removes the config so proxy is now enabled.

## Changelog

[Android] [Changed] - Use default for hermes es6 proxy enabled

Pull Request resolved: #30142

Test Plan: Tested that proxy is now enabled (typeof Proxy !== 'undefined') with hermes 0.7.

Reviewed By: cpojer

Differential Revision: D24494182

Pulled By: mhorowitz

fbshipit-source-id: 7f8a506e2c436f2f1611e183ca22d33dc763643c
  • Loading branch information
janicduplessis authored and facebook-github-bot committed Oct 23, 2020
1 parent 3a41f69 commit a28dd38
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ public class HermesExecutor extends JavaScriptExecutor {
}

HermesExecutor(@Nullable RuntimeConfig config) {
super(
config == null
? initHybridDefaultConfig()
: initHybrid(config.heapSizeMB, config.es6Proxy));
super(config == null ? initHybridDefaultConfig() : initHybrid(config.heapSizeMB));
}

@Override
Expand All @@ -50,5 +47,5 @@ public String getName() {

private static native HybridData initHybridDefaultConfig();

private static native HybridData initHybrid(long heapSizeMB, boolean es6Proxy);
private static native HybridData initHybrid(long heapSizeMB);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
namespace facebook {
namespace react {

static ::hermes::vm::RuntimeConfig makeRuntimeConfig(
jlong heapSizeMB,
bool es6Proxy) {
static ::hermes::vm::RuntimeConfig makeRuntimeConfig(jlong heapSizeMB) {
namespace vm = ::hermes::vm;
auto gcConfigBuilder =
vm::GCConfig::Builder()
Expand All @@ -40,7 +38,6 @@ static ::hermes::vm::RuntimeConfig makeRuntimeConfig(

return vm::RuntimeConfig::Builder()
.withGCConfig(gcConfigBuilder.build())
.withES6Proxy(es6Proxy)
.build();
}

Expand Down Expand Up @@ -69,10 +66,11 @@ class HermesExecutorHolder
std::make_unique<HermesExecutorFactory>(installBindings));
}

static jni::local_ref<jhybriddata>
initHybrid(jni::alias_ref<jclass>, jlong heapSizeMB, bool es6Proxy) {
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass>,
jlong heapSizeMB) {
JReactMarker::setLogPerfMarkerIfNeeded();
auto runtimeConfig = makeRuntimeConfig(heapSizeMB, es6Proxy);
auto runtimeConfig = makeRuntimeConfig(heapSizeMB);
return makeCxxInstance(std::make_unique<HermesExecutorFactory>(
installBindings, JSIExecutor::defaultTimeoutInvoker, runtimeConfig));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/** Holds runtime configuration for a Hermes VM instance (master or snapshot). */
public final class RuntimeConfig {
public long heapSizeMB;
public boolean es6Proxy;

RuntimeConfig() {}

Expand Down

0 comments on commit a28dd38

Please sign in to comment.