<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>133858</bug_id>
          
          <creation_ts>2014-06-13 08:26:55 -0700</creation_ts>
          <short_desc>REGRESSION: global object with custom class in iOS 8.0 or OS X 10.10</short_desc>
          <delta_ts>2014-06-18 11:04:07 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Isaac Burns">isaacburns</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ggaren</cc>
    
    <cc>mhahnenberg</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1015434</commentid>
    <comment_count>0</comment_count>
    <who name="Isaac Burns">isaacburns</who>
    <bug_when>2014-06-13 08:26:55 -0700</bug_when>
    <thetext>The following code identifies a regression in the iOS SDK 8.0 and OS X SDK 10.10.

JSContextGetGlobalObject no longer returns the object with the custom class.

This may be related to the following bugs.
https://bugs.webkit.org/show_bug.cgi?id=133531
https://bugs.webkit.org/show_bug.cgi?id=133532

#include &lt;JavaScriptCore/JavaScriptCore.h&gt;

static bool _hasProperty(JSContextRef js_ctx, JSObjectRef js_object, JSStringRef js_name)
{
	// iOS SDK 7.1 and OS X SDK 10.9: PASS, iOS SDK 8.0 and OS X SDK 10.10: FAIL
	assert(JSValueIsStrictEqual(js_ctx, js_object, JSContextGetGlobalObject(js_ctx)));
	return false;
}

int main(int argc, char * argv[])
{
	JSClassDefinition js_class_def = kJSClassDefinitionEmpty;
	js_class_def.hasProperty = _hasProperty;
	JSClassRef js_class = JSClassCreate(&amp;js_class_def);
	JSGlobalContextRef js_ctx = JSGlobalContextCreate(js_class);
	// iOS SDK 7.1 and OS X SDK 10.9: PASS, iOS SDK 8.0 and OS X SDK 10.10: FAIL
	assert(JSValueIsObjectOfClass(js_ctx, JSContextGetGlobalObject(js_ctx), js_class));
	JSStringRef js_name = JSStringCreateWithUTF8CString(&quot;Object&quot;);
	assert(JSObjectHasProperty(js_ctx, JSContextGetGlobalObject(js_ctx), js_name));
	JSStringRelease(js_name); js_name = NULL;
	JSGlobalContextRelease(js_ctx); js_ctx = NULL;
	JSClassRelease(js_class); js_class = NULL;
	return 0;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1016234</commentid>
    <comment_count>1</comment_count>
    <who name="Isaac Burns">isaacburns</who>
    <bug_when>2014-06-17 13:38:30 -0700</bug_when>
    <thetext>This continues to be the case with iOS 8.0 Beta 2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1016497</commentid>
    <comment_count>2</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2014-06-18 11:04:07 -0700</bug_when>
    <thetext>This was an intentional change to make behavior outside of WebKit match behavior inside WebKit.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>