[V8] Implement V8Binding::v8Null(isolate) and use it in CodeGeneratorV8.pm
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2012 06:42:08 +0000 (06:42 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2012 06:42:08 +0000 (06:42 +0000)
commite00d00b0690656bbd93463d638a7d63fdb179ffb
tree8f764c2d72cbef347fc25f244047f77b81ae9627
parentaf32e3afec114696510fb1b6ad466571d84233b3
[V8] Implement V8Binding::v8Null(isolate) and use it in CodeGeneratorV8.pm
https://bugs.webkit.org/show_bug.cgi?id=87692

Reviewed by Adam Barth.

Since v8::Null(isolate) crashes if we pass a NULL isolate, we are planning
to pass Isolate to v8::Null() in the following steps:

[1] Implement V8Bindings::v8Null(isolate). v8Null(isolate) does the NULL check.
If isolate is NULL, v8Null(isolate) calls v8::Null(). Otherwise,
v8Null(isolate) calls v8::Null(isolate).

[2] In V8 bindings, we replace v8::Null() with v8::Null(isolate) for a non-optional
'isolate' parameter. (e.g. void foo(..., Isolate* isolate) { v8::Null(); } )

[3] In V8 bindings, we replace v8::Null() with v8Null(isolate) for an optional
'isolate' parameter. (e.g. void foo(..., Isolate* isolate = 0) { v8::Null(); } )

This bug fixes [1] by implementing V8Binding::v8Null(isolate). Also this patch uses
V8Binding::v8Null(isolate) in bindings/v8/*.{h,cpp}.

No tests. No behavior change.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):
(NativeToJSValue):
* bindings/scripts/test/V8/V8Float64Array.h:
* bindings/scripts/test/V8/V8TestActiveDOMObject.h:
(WebCore::toV8):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.h:
(WebCore::toV8):
* bindings/scripts/test/V8/V8TestEventConstructor.h:
(WebCore::toV8):
* bindings/scripts/test/V8/V8TestEventTarget.h:
(WebCore::toV8):
* bindings/scripts/test/V8/V8TestException.h:
(WebCore::toV8):
* bindings/scripts/test/V8/V8TestInterface.h:
(WebCore::toV8):
* bindings/scripts/test/V8/V8TestMediaQueryListListener.h:
(WebCore::toV8):
* bindings/scripts/test/V8/V8TestNamedConstructor.h:
(WebCore::toV8):
* bindings/scripts/test/V8/V8TestNode.h:
(WebCore::toV8):
* bindings/scripts/test/V8/V8TestObj.h:
(WebCore::toV8):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
(WebCore::TestSerializedScriptValueInterfaceV8Internal::valueAttrGetter):
(WebCore::TestSerializedScriptValueInterfaceV8Internal::readonlyValueAttrGetter):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:
(WebCore::toV8):
* bindings/v8/V8Binding.h:
(WebCore::v8Null):
(WebCore):
(WebCore::v8DateOrNull):
* bindings/v8/V8DOMWrapper.cpp:
* bindings/v8/V8DOMWrapper.h:
(WebCore):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h
Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h
Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h
Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h
Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h
Source/WebCore/bindings/scripts/test/V8/V8TestException.h
Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h
Source/WebCore/bindings/scripts/test/V8/V8TestNode.h
Source/WebCore/bindings/scripts/test/V8/V8TestObj.h
Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h
Source/WebCore/bindings/v8/V8Binding.h
Source/WebCore/bindings/v8/V8DOMWrapper.cpp
Source/WebCore/bindings/v8/V8DOMWrapper.h