| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 29 matching lines...) Expand all Loading... |
| 40 #include "modules/webdatabase/SQLResultSet.h" | 40 #include "modules/webdatabase/SQLResultSet.h" |
| 41 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
| 42 | 42 |
| 43 using namespace WTF; | 43 using namespace WTF; |
| 44 | 44 |
| 45 namespace WebCore { | 45 namespace WebCore { |
| 46 | 46 |
| 47 void V8SQLTransactionSync::executeSqlMethodCustom(const v8::FunctionCallbackInfo
<v8::Value>& args) | 47 void V8SQLTransactionSync::executeSqlMethodCustom(const v8::FunctionCallbackInfo
<v8::Value>& args) |
| 48 { | 48 { |
| 49 if (!args.Length()) { | 49 if (!args.Length()) { |
| 50 setDOMException(SYNTAX_ERR, args.GetIsolate()); | 50 setDOMException(SyntaxError, args.GetIsolate()); |
| 51 return; | 51 return; |
| 52 } | 52 } |
| 53 | 53 |
| 54 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, statement, args[0])
; | 54 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, statement, args[0])
; |
| 55 | 55 |
| 56 Vector<SQLValue> sqlValues; | 56 Vector<SQLValue> sqlValues; |
| 57 | 57 |
| 58 if (args.Length() > 1 && !isUndefinedOrNull(args[1])) { | 58 if (args.Length() > 1 && !isUndefinedOrNull(args[1])) { |
| 59 if (!args[1]->IsObject()) { | 59 if (!args[1]->IsObject()) { |
| 60 setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate()); | 60 setDOMException(TypeMismatchError, args.GetIsolate()); |
| 61 return; | 61 return; |
| 62 } | 62 } |
| 63 | 63 |
| 64 uint32_t sqlArgsLength = 0; | 64 uint32_t sqlArgsLength = 0; |
| 65 v8::Local<v8::Object> sqlArgsObject = args[1]->ToObject(); | 65 v8::Local<v8::Object> sqlArgsObject = args[1]->ToObject(); |
| 66 V8TRYCATCH_VOID(v8::Local<v8::Value>, length, sqlArgsObject->Get(v8::Str
ing::New("length"))); | 66 V8TRYCATCH_VOID(v8::Local<v8::Value>, length, sqlArgsObject->Get(v8::Str
ing::New("length"))); |
| 67 | 67 |
| 68 if (isUndefinedOrNull(length)) | 68 if (isUndefinedOrNull(length)) |
| 69 sqlArgsLength = sqlArgsObject->GetPropertyNames()->Length(); | 69 sqlArgsLength = sqlArgsObject->GetPropertyNames()->Length(); |
| 70 else | 70 else |
| (...skipping 18 matching lines...) Expand all Loading... |
| 89 SQLTransactionSync* transaction = V8SQLTransactionSync::toNative(args.Holder
()); | 89 SQLTransactionSync* transaction = V8SQLTransactionSync::toNative(args.Holder
()); |
| 90 | 90 |
| 91 ExceptionCode ec = 0; | 91 ExceptionCode ec = 0; |
| 92 v8::Handle<v8::Value> result = toV8Fast(transaction->executeSQL(statement, s
qlValues, ec), args, transaction); | 92 v8::Handle<v8::Value> result = toV8Fast(transaction->executeSQL(statement, s
qlValues, ec), args, transaction); |
| 93 setDOMException(ec, args.GetIsolate()); | 93 setDOMException(ec, args.GetIsolate()); |
| 94 | 94 |
| 95 v8SetReturnValue(args, result); | 95 v8SetReturnValue(args, result); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace WebCore | 98 } // namespace WebCore |
| OLD | NEW |