0
나는 JavaScriptCore는 프레임 워크와 함께 놀아 오전 자바 스크립트 맥락에서 논리 값을 생성하는 두 가지 방법을 발견했다
:JSValue 초기화 (부울 : JSValueMakeBoolean() 대 :)에서
import JavaScriptCore
let context = JSContext()
let trueVal = JSValue(bool: true, in: context)
JSValueIsBoolean(context?.jsGlobalContextRef, trueVal?.jsValueRef) // true
let otherTrueValue = JSValueMakeBoolean(context?.jsGlobalContextRef, true)
JSValueIsBoolean(context?.jsGlobalContextRef, otherTrueValue) // true
이 JSValue(bool:in:)
을의 차이 무엇입니까 및 JSValueMakeBoolean
?
JSValueRef
대해 생성 된 헤더 댓글 유지