OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 uint32_t sqlArgsLength = 0; | 68 uint32_t sqlArgsLength = 0; |
69 v8::Local<v8::Object> sqlArgsObject = info[1]->ToObject(); | 69 v8::Local<v8::Object> sqlArgsObject = info[1]->ToObject(); |
70 V8TRYCATCH_VOID(v8::Local<v8::Value>, length, sqlArgsObject->Get(v8Atomi
cString(info.GetIsolate(), "length"))); | 70 V8TRYCATCH_VOID(v8::Local<v8::Value>, length, sqlArgsObject->Get(v8Atomi
cString(info.GetIsolate(), "length"))); |
71 | 71 |
72 if (isUndefinedOrNull(length)) | 72 if (isUndefinedOrNull(length)) |
73 sqlArgsLength = sqlArgsObject->GetPropertyNames()->Length(); | 73 sqlArgsLength = sqlArgsObject->GetPropertyNames()->Length(); |
74 else | 74 else |
75 sqlArgsLength = length->Uint32Value(); | 75 sqlArgsLength = length->Uint32Value(); |
76 | 76 |
77 for (unsigned int i = 0; i < sqlArgsLength; ++i) { | 77 for (unsigned i = 0; i < sqlArgsLength; ++i) { |
78 v8::Handle<v8::Integer> key = v8::Integer::New(info.GetIsolate(), i)
; | 78 v8::Handle<v8::Integer> key = v8::Integer::New(info.GetIsolate(), i)
; |
79 V8TRYCATCH_VOID(v8::Local<v8::Value>, value, sqlArgsObject->Get(key)
); | 79 V8TRYCATCH_VOID(v8::Local<v8::Value>, value, sqlArgsObject->Get(key)
); |
80 | 80 |
81 if (value.IsEmpty() || value->IsNull()) | 81 if (value.IsEmpty() || value->IsNull()) |
82 sqlValues.append(SQLValue()); | 82 sqlValues.append(SQLValue()); |
83 else if (value->IsNumber()) { | 83 else if (value->IsNumber()) { |
84 V8TRYCATCH_VOID(double, sqlValue, value->NumberValue()); | 84 V8TRYCATCH_VOID(double, sqlValue, value->NumberValue()); |
85 sqlValues.append(SQLValue(sqlValue)); | 85 sqlValues.append(SQLValue(sqlValue)); |
86 } else { | 86 } else { |
87 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, sqlValu
e, value); | 87 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, sqlValu
e, value); |
(...skipping 24 matching lines...) Expand all Loading... |
112 return; | 112 return; |
113 } | 113 } |
114 errorCallback = V8SQLStatementErrorCallback::create(v8::Handle<v8::Funct
ion>::Cast(info[3]), executionContext); | 114 errorCallback = V8SQLStatementErrorCallback::create(v8::Handle<v8::Funct
ion>::Cast(info[3]), executionContext); |
115 } | 115 } |
116 | 116 |
117 transaction->executeSQL(statement, sqlValues, callback.release(), errorCallb
ack.release(), exceptionState); | 117 transaction->executeSQL(statement, sqlValues, callback.release(), errorCallb
ack.release(), exceptionState); |
118 exceptionState.throwIfNeeded(); | 118 exceptionState.throwIfNeeded(); |
119 } | 119 } |
120 | 120 |
121 } // namespace WebCore | 121 } // namespace WebCore |
OLD | NEW |