[V8] Notification.requestPermission(function() {alert();}) crashes
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Sep 2012 01:36:24 +0000 (01:36 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Sep 2012 01:36:24 +0000 (01:36 +0000)
commitda89af4b091f23f20ee824e58afc58a24b728973
treed2c046ac877763a82a1a44b678eb60447fd14631
parent195fdecef1a7e34951e22216f08ac15b70d2e166
[V8] Notification.requestPermission(function() {alert();}) crashes
https://bugs.webkit.org/show_bug.cgi?id=94462

Reviewed by Adam Barth.

Source/WebCore:

Since Notification.requestPermission() is a static method,
we need to use getExecutionContext() instead of retrieving a context
from a DOM object.

Test: http/tests/notifications/notification-request-permission.html

* bindings/v8/custom/V8NotificationCustom.cpp:
(WebCore::V8Notification::requestPermissionCallback):

LayoutTests:

The added test checks if Notification.requestPermission() does not crash.

* http/tests/notifications/notification-request-permission-expected.txt: Added.
* http/tests/notifications/notification-request-permission.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/notifications/notification-request-permission-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/notifications/notification-request-permission.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp