Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Unified Diff: Source/bindings/dart/DartUtilities.h

Issue 368663002: Restore interpretation of Dart null as undefined in dartToScriptValueWithNullCheck. (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1985
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/DartUtilities.h
diff --git a/Source/bindings/dart/DartUtilities.h b/Source/bindings/dart/DartUtilities.h
index 132c06686a97a2b5f28934a5efb6792975976305..48afec3d42cce39741d3f521c03bf77b9025b15a 100644
--- a/Source/bindings/dart/DartUtilities.h
+++ b/Source/bindings/dart/DartUtilities.h
@@ -534,6 +534,10 @@ public:
// to observe from user code.
static ScriptValue dartToScriptValueWithNullCheck(Dart_Handle handle)
{
+ if (Dart_IsNull(handle)) {
+ V8ScriptState* scriptState = v8ScriptStateForCurrentIsolate();
+ return ScriptValue(scriptState, v8::Undefined(scriptState->isolate()));
vsm 2014/07/01 17:12:52 Did you consider a DartScriptValue wrapping undefi
rmacnak 2014/07/01 17:20:02 Right now a DartScriptValue never has an empty han
+ }
return dartToScriptValue(handle);
}
static ScriptValue dartToScriptValueWithNullCheck(Dart_NativeArguments args, int index)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698