Skip to content

Instantly share code, notes, and snippets.

@tjw
Created July 15, 2016 04:04
Show Gist options
  • Save tjw/bc5392a4545f51074c2e9921cff59bcb to your computer and use it in GitHub Desktop.
Save tjw/bc5392a4545f51074c2e9921cff59bcb to your computer and use it in GitHub Desktop.
Radar 27365520
import JavaScriptCore
let ctx = JSGlobalContextCreate(nil)
let trueValue = JSValueMakeBoolean(ctx, true)
// This returns false in both Xcode 7.3.1 and 8.0 b2.
JSValueIsObject(ctx, trueValue)
// This returns true in Xcode 7.3.1, and false in 8.0 b2.
JSValueIsBoolean(ctx, trueValue)
// In Xcode 7.3.1, this returns `2` (kJSTypeBoolean).
// In Xcode 8.0 b2, this returns `5` (kJSTypeObject).
JSValueGetType(ctx, trueValue).rawValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment