feat:add set environment value api
This commit is contained in:
@@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)teardown;
|
||||
|
||||
- (void)setEnvironment:(NSString *)key variable:(id)value;
|
||||
- (void)setEnvironmentValue:(NSDictionary *)value;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -106,9 +106,9 @@ - (instancetype)init {
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setEnvironment:(NSString *)key variable:(id)value {
|
||||
- (void)setEnvironmentValue:(NSDictionary *)value {
|
||||
[self ensureRunOnJSThread:^{
|
||||
self.environmentDictionary[key] = value;
|
||||
[self.environmentDictionary addEntriesFromDictionary:value];
|
||||
if (self.initialized) {
|
||||
[self.jsExecutor injectGlobalJSObject:INJECT_ENVIRONMENT obj:[self.environmentDictionary copy]];
|
||||
for (DoricContext *doricContext in DoricContextManager.instance.aliveContexts) {
|
||||
|
Reference in New Issue
Block a user