<?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>27515</bug_id>
          
          <creation_ts>2009-07-21 13:49:53 -0700</creation_ts>
          <short_desc>Implement AbstractWorker::dispatchScriptErrorEvent by generating an ErrorEvent.</short_desc>
          <delta_ts>2009-07-21 20:22:32 -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>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          
          <blocked>27525</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jian Li">jianli</reporter>
          <assigned_to name="Jian Li">jianli</assigned_to>
          <cc>levin</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>133584</commentid>
    <comment_count>0</comment_count>
    <who name="Jian Li">jianli</who>
    <bug_when>2009-07-21 13:49:53 -0700</bug_when>
    <thetext>Implement AbstractWorker::dispatchScriptErrorEvent by generating an ErrorEvent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133591</commentid>
    <comment_count>1</comment_count>
      <attachid>33211</attachid>
    <who name="Jian Li">jianli</who>
    <bug_when>2009-07-21 14:00:04 -0700</bug_when>
    <thetext>Created attachment 33211
Proposed Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133609</commentid>
    <comment_count>2</comment_count>
    <who name="Jian Li">jianli</who>
    <bug_when>2009-07-21 14:48:13 -0700</bug_when>
    <thetext>This is to adhere to the latest Web Worker spec (http://www.whatwg.org/specs/web-workers/current-work/#runtime-script-errors):

  When the user agent is to fire a worker error event at a Worker object, it must dispatch an event that uses the ErrorEvent interface, with the name error, that doesn&apos;t bubble and is cancelable, with its message, filename, and lineno attributes set appropriately.

I will have other patch that will fix the error handling flow in WorkerContext and Worker.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133651</commentid>
    <comment_count>3</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2009-07-21 16:42:24 -0700</bug_when>
    <thetext>&gt; I will have other patch that will fix the error handling flow in WorkerContext
and Worker.
Please file a bug for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133664</commentid>
    <comment_count>4</comment_count>
      <attachid>33211</attachid>
    <who name="David Levin">levin</who>
    <bug_when>2009-07-21 17:25:04 -0700</bug_when>
    <thetext>Comment on attachment 33211
Proposed Patch

Please do a variable name change below before landing.


&gt; +void AbstractWorker::dispatchScriptErrorEvent(const String&amp; message, const String&amp; sourceURL, int lineNumber)
&gt;  {
&gt; +    RefPtr&lt;ErrorEvent&gt; evt = ErrorEvent::create(message, sourceURL, static_cast&lt;unsigned&gt;(lineNumber));

Use full words, except in the rare case where an abbreviation would be more canonical and easier to understand.
s/evt/event/

&gt; +    if (m_onErrorListener) {
&gt; +        evt-&gt;setTarget(this);
&gt; +        evt-&gt;setCurrentTarget(this);
&gt; +        m_onErrorListener-&gt;handleEvent(evt.get(), true);
&gt; +    }
&gt; +
&gt; +    ExceptionCode ec = 0;
&gt; +    dispatchEvent(evt.release(), ec);
&gt; +    ASSERT(!ec);
&gt;  }
&gt;  
&gt;  } // namespace WebCore</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133670</commentid>
    <comment_count>5</comment_count>
    <who name="Jian Li">jianli</who>
    <bug_when>2009-07-21 17:44:19 -0700</bug_when>
    <thetext>Committed as http://trac.webkit.org/changeset/46203</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133679</commentid>
    <comment_count>6</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2009-07-21 18:59:18 -0700</bug_when>
    <thetext>This should really have a test case.  Is there a reason this cannot be tested?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133684</commentid>
    <comment_count>7</comment_count>
    <who name="Jian Li">jianli</who>
    <bug_when>2009-07-21 20:22:32 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; This should really have a test case.  Is there a reason this cannot be tested?

This is the first patch towards fixing error handling in workers. It can not be tested before completing the changes for 27525. I will add test cases in dealing with 27525.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>33211</attachid>
            <date>2009-07-21 14:00:04 -0700</date>
            <delta_ts>2009-07-21 17:25:04 -0700</delta_ts>
            <desc>Proposed Patch</desc>
            <filename>27515</filename>
            <type>text/plain</type>
            <size>1671</size>
            <attacher name="Jian Li">jianli</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
MmQ4MWQ0NC4uMGQyODM2ZSAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxMyBAQAorMjAwOS0wNy0yMSAgSmlhbiBMaSAgPGpp
YW5saUBjaHJvbWl1bS5vcmc+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISku
CisKKyAgICAgICAgSW1wbGVtZW50IEFic3RyYWN0V29ya2VyOjpkaXNwYXRjaFNjcmlwdEVycm9y
RXZlbnQgYnkgZ2VuZXJhdGluZyBhbiBFcnJvckV2ZW50LgorICAgICAgICBodHRwczovL2J1Z3Mu
d2Via2l0Lm9yZ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FnZSwgY29uc3QgU3RyaW5nJiBzb3VyY2VVUkwsIGludCBsaW5lTnVtYmVyKQogewotICAg
IC8vRklYTUU6IEdlbmVyYXRlIGFuIEVycm9yRXZlbnQgaW5zdGVhZCBvZiBhIHNpbXBsZSBldmVu
dAotICAgIGRpc3BhdGNoTG9hZEVycm9yRXZlbnQoKTsKKyAgICBSZWZQdHI8RXJyb3JFdmVudD4g
ZXZ0ID0gRXJyb3JFdmVudDo6Y3JlYXRlKG1lc3NhZ2UsIHNvdXJjZVVSTCwgc3RhdGljX2Nhc3Q8
dW5zaWduZWQ+KGxpbmVOdW1iZXIpKTsKKyAgICBpZiAobV9vbkVycm9yTGlzdGVuZXIpIHsKKyAg
ICAgICAgZXZ0LT5zZXRUYXJnZXQodGhpcyk7CisgICAgICAgIGV2dC0+c2V0Q3VycmVudFRhcmdl
dCh0aGlzKTsKKyAgICAgICAgbV9vbkVycm9yTGlzdGVuZXItPmhhbmRsZUV2ZW50KGV2dC5nZXQo
KSwgdHJ1ZSk7CisgICAgfQorCisgICAgRXhjZXB0aW9uQ29kZSBlYyA9IDA7CisgICAgZGlzcGF0
Y2hFdmVudChldnQucmVsZWFzZSgpLCBlYyk7CisgICAgQVNTRVJUKCFlYyk7CiB9CiAKIH0gLy8g
bmFtZXNwYWNlIFdlYkNvcmUK
</data>
<flag name="review"
          id="17526"
          type_id="1"
          status="+"
          setter="levin"
    />
          </attachment>
      

    </bug>

</bugzilla>