New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 269538 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
OOO until 4th
Closed: Oct 2013
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 270005



Sign in to add a comment

Correctly attribute exceptions thrown inside a Worker's imported scripts.

Project Member Reported by mkwst@chromium.org, Aug 7 2013

Issue description

Currently, we have strange behavior when a script loaded into a worker
via 'importScripts()' throws an exception:

* Rather than reporting the exception's full details for same-origin
  scripts, the exception is rethrown from the point at which
  'importScripts()' is called. The error parameter is also not
  populated. This makes it difficult to determine
  where the exception actually occurred.

* Exceptions thrown from cross-origin scripts are incorrectly
  sanitized: the message is generally "Uncaught undefined", and the
  file/line/column all point to the 'importScripts()' call.

 

Comment 1 by mkwst@chromium.org, Aug 8 2013

Blocking: chromium:270005
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 9 2013

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=155824

------------------------------------------------------------------------
r155824 | mkwst@chromium.org | 2013-08-09T05:19:46.160358Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-expected.txt?r1=155824&r2=155823&pathrev=155824
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/win/http/tests/workers/worker-importScripts-expected.txt?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-onerror-redirect-to-crossorigin-expected.txt?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-onerror-crossorigin-expected.txt?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/shared-worker-importScripts-expected.txt?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-onerror-sameorigin.html?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/workers/WorkerGlobalScope.cpp?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/resources/worker-importscripts-onerror-sameorigin.js?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-onerror-redirect-to-crossorigin.html?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-onerror-crossorigin.html?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/resources/worker-importscripts-onerror-redirect-to-crossorigin.js?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/WorkerScriptController.cpp?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/resources/worker-importscripts-onerror-crossorigin.js?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-onerror-sameorigin-expected.txt?r1=155824&r2=155823&pathrev=155824
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/WorkerScriptController.h?r1=155824&r2=155823&pathrev=155824

Correctly attribute exceptions thrown inside a Worker's imported scripts.

Currently, we have strange behavior when a script loaded into a worker
via 'importScripts()' throws an exception:

* Rather than reporting the exception's full details for same-origin
  scripts, the exception is rethrown from the point at which
  'importScripts()' is called. This makes it difficult to determine
  where the exception actually occurred.

* Exceptions thrown from cross-origin scripts are incorrectly
  sanitized: the message is generally "Uncaught undefined", and the
  file/line/column all point to the 'importScripts()' call.

This patch corrects both cases: cross-origin exceptions are sanitized
in the same way that we sanitize non-worker exceptions (message of
"Script error.", blank file, line and column both set to 0). Same-origin
exceptions now contain accurate file/line/column information.

Note that this patch does not address the 'error' parameter for
same-origin exceptions.

BUG= 269538 

Review URL: https://chromiumcodereview.appspot.com/22467005
------------------------------------------------------------------------

Comment 3 by mkwst@chromium.org, Oct 14 2013

Status: Fixed

Sign in to add a comment