1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "config.h" 6 #include "core/animation/AnimationTestHelper.h" 7 8 #include "bindings/v8/V8Binding.h" 9 10 namespace WebCore { 11 12 v8::Handle<v8::Value> stringToV8Value(String string) 13 { 14 return v8::Handle<v8::Value>::Cast(v8String(v8::Isolate::GetCurrent(), string)); 15 } 16 17 v8::Handle<v8::Value> doubleToV8Value(double number) 18 { 19 return v8::Handle<v8::Value>::Cast(v8::Number::New(v8::Isolate::GetCurrent(), number)); 20 } 21 22 void setV8ObjectPropertyAsString(v8::Handle<v8::Object> object, String name, String value) 23 { 24 object->Set(stringToV8Value(name), stringToV8Value(value)); 25 } 26 27 void setV8ObjectPropertyAsNumber(v8::Handle<v8::Object> object, String name, double value) 28 { 29 object->Set(stringToV8Value(name), doubleToV8Value(value)); 30 } 31 32 } // namespace WebCore 33