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

Side by Side Diff: Source/bindings/core/v8/V8ObjectBuilder.cpp

Issue 1153613007: bindings: Use CreateDataProperty() instead of ForceSet() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix uninitialized error Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "bindings/core/v8/V8ObjectBuilder.h" 6 #include "bindings/core/v8/V8ObjectBuilder.h"
7 7
8 #include "bindings/core/v8/V8Binding.h" 8 #include "bindings/core/v8/V8Binding.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 ScriptValue V8ObjectBuilder::scriptValue() const 48 ScriptValue V8ObjectBuilder::scriptValue() const
49 { 49 {
50 return ScriptValue(m_scriptState.get(), m_object); 50 return ScriptValue(m_scriptState.get(), m_object);
51 } 51 }
52 52
53 void V8ObjectBuilder::addInternal(const String& name, v8::Local<v8::Value> value ) 53 void V8ObjectBuilder::addInternal(const String& name, v8::Local<v8::Value> value )
54 { 54 {
55 if (m_object.IsEmpty()) 55 if (m_object.IsEmpty())
56 return; 56 return;
57 if (value.IsEmpty() || m_object->ForceSet(m_scriptState->context(), v8String (m_scriptState->isolate(), name), value).IsNothing()) 57 if (value.IsEmpty() || m_object->CreateDataProperty(m_scriptState->context() , v8String(m_scriptState->isolate(), name), value).IsNothing())
58 m_object.Clear(); 58 m_object.Clear();
59 } 59 }
60 60
61 } // namespace blink 61 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8LazyEventListener.cpp ('k') | Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698