| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |