Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios11.1 在co_launch中WebView执行js闪退 #99

Closed
iDivines opened this issue Dec 16, 2019 · 1 comment
Closed

ios11.1 在co_launch中WebView执行js闪退 #99

iDivines opened this issue Dec 16, 2019 · 1 comment

Comments

@iDivines
Copy link

Context and Description

在ios11.1中,无论是UIWebView还是UIWebView执行JS都会闪退

Environment Details

  • coobjc version:1.2.6
  • iOS version: 11.1(ios其他版本没有出现)
  • Xcode version:xcode11.2
  • Other informations:

Code

- (void)viewWillAppear:(BOOL)animated
{
    co_launch(^{
        UIWebView *web = [[UIWebView alloc] init];
        [web stringByEvaluatingJavaScriptFromString:@"var a=1"];
    });
}

Stack

#0	0x000000018b24bc60 in JSC::BuiltinExecutables::createExecutable(JSC::VM&, JSC::SourceCode const&, JSC::Identifier const&, JSC::ConstructorKind, JSC::ConstructAbility) ()
#1	0x000000018b24f994 in JSC::BuiltinExecutables::functionPrototypeApplyCodeExecutable() ()
#2	0x000000018b6755fc in JSC::functionPrototypeApplyCodeGenerator(JSC::VM&) ()
#3	0x000000018b5897c0 in JSC::FunctionPrototype::addFunctionProperties(JSC::ExecState*, JSC::JSGlobalObject*, JSC::JSFunction**, JSC::JSFunction**, JSC::JSFunction**) ()
#4	0x000000018b688200 in JSC::JSGlobalObject::init(JSC::VM&) ()
#5	0x000000018b69203c in JSC::JSGlobalObject::finishCreation(JSC::VM&, JSC::JSObject*) ()
#6	0x000000018c45d4f8 in WebCore::JSDOMGlobalObject::finishCreation(JSC::VM&, JSC::JSObject*) ()
#7	0x000000018cc5c36c in WebCore::JSDOMWindowBase::finishCreation(JSC::VM&, WebCore::JSDOMWindowProxy*) ()
#8	0x000000018cbe6b38 in WebCore::JSDOMWindow::finishCreation(JSC::VM&, WebCore::JSDOMWindowProxy*) ()
#9	0x000000018cc600a8 in WebCore::JSDOMWindowProxy::setWindow(WTF::RefPtr<WebCore::DOMWindow>&&) ()
#10	0x000000018d2b1d40 in WebCore::ScriptController::createWindowProxy(WebCore::DOMWrapperWorld&) ()
#11	0x000000018d2b3620 in WebCore::ScriptController::initScript(WebCore::DOMWrapperWorld&) ()
#12	0x000000018d8355bc in -[WebFrame(WebInternal) _stringByEvaluatingJavaScriptFromString:forceUserGesture:] ()
#13	0x000000018e047a6c in -[UIWebView stringByEvaluatingJavaScriptFromString:] ()
#14	0x0000000102dfd2d8 in __47-[KMDiscoverListViewController viewWillAppear:]_block_invoke at /Users/idivines/Downloads/coobjc-master/Examples/coobjcBaseExample/coobjcBaseExample/UI/View Controllers/Discover List/KMDiscoverListViewController.m:39
#15	0x0000000102f014ac in -[COCoroutine execute] at /Users/idivines/Downloads/coobjc-master/coobjc/co/COCoroutine.m:111
#16	0x0000000102f01ab0 in co_exec at /Users/idivines/Downloads/coobjc-master/coobjc/co/COCoroutine.m:84
#17	0x0000000102ed8a20 in coroutine_main at /Users/idivines/Downloads/coobjc-master/cocore/coroutine.m:189
Enqueued from com.apple.main-thread (Thread 1) Queue : com.apple.main-thread (serial)
#0	0x0000000103225280 in _dispatch_introspection_queue_item_enqueue_hook ()
#1	0x0000000103204c50 in _dispatch_queue_push ()
#2	0x0000000102ed6ffc in -[CODispatch dispatch_async_block:] at /Users/idivines/Downloads/coobjc-master/cocore/CODispatch.m:120
#3	0x0000000102f0253c in -[COCoroutine resume] at /Users/idivines/Downloads/coobjc-master/coobjc/co/COCoroutine.m:224
#4	0x0000000102dfd228 in co_launch [inlined] at /Users/idivines/Library/Developer/Xcode/DerivedData/coobjcBaseExample-fgmirdsavivlplbvbjlaebcijqcf/Build/Products/Debug-iphoneos/coobjc/coobjc.framework/Headers/coobjc.h:54
#5	0x0000000102dfd1f0 in -[KMDiscoverListViewController viewWillAppear:] at /Users/idivines/Downloads/coobjc-master/Examples/coobjcBaseExample/coobjcBaseExample/UI/View Controllers/Discover List/KMDiscoverListViewController.m:37
@iDivines iDivines changed the title ios11.1 在co_launch中WebView执行js ios11.1 在co_launch中WebView执行js闪退 Dec 16, 2019
@NianJi
Copy link
Collaborator

NianJi commented Mar 6, 2020

coobjc 不支持协程能运行 JSCore相关代码,see #68

@iDivines iDivines closed this as completed Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants