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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 exceptionState.throwIfNeeded(); | 62 exceptionState.throwIfNeeded(); |
63 return; | 63 return; |
64 } | 64 } |
65 | 65 |
66 v8::Local<v8::Object> item = v8::Object::New(info.GetIsolate()); | 66 v8::Local<v8::Object> item = v8::Object::New(info.GetIsolate()); |
67 unsigned numColumns = rowList->columnNames().size(); | 67 unsigned numColumns = rowList->columnNames().size(); |
68 unsigned valuesIndex = index * numColumns; | 68 unsigned valuesIndex = index * numColumns; |
69 | 69 |
70 for (unsigned i = 0; i < numColumns; ++i) { | 70 for (unsigned i = 0; i < numColumns; ++i) { |
71 const SQLValue& sqlValue = rowList->values()[valuesIndex + i]; | 71 const SQLValue& sqlValue = rowList->values()[valuesIndex + i]; |
72 v8::Handle<v8::Value> value; | 72 v8::Local<v8::Value> value; |
73 switch (sqlValue.type()) { | 73 switch (sqlValue.type()) { |
74 case SQLValue::StringValue: | 74 case SQLValue::StringValue: |
75 value = v8String(info.GetIsolate(), sqlValue.string()); | 75 value = v8String(info.GetIsolate(), sqlValue.string()); |
76 break; | 76 break; |
77 case SQLValue::NullValue: | 77 case SQLValue::NullValue: |
78 value = v8::Null(info.GetIsolate()); | 78 value = v8::Null(info.GetIsolate()); |
79 break; | 79 break; |
80 case SQLValue::NumberValue: | 80 case SQLValue::NumberValue: |
81 value = v8::Number::New(info.GetIsolate(), sqlValue.number()); | 81 value = v8::Number::New(info.GetIsolate(), sqlValue.number()); |
82 break; | 82 break; |
83 default: | 83 default: |
84 ASSERT_NOT_REACHED(); | 84 ASSERT_NOT_REACHED(); |
85 } | 85 } |
86 | 86 |
87 item->ForceSet(v8String(info.GetIsolate(), rowList->columnNames()[i]), v
alue, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); | 87 item->ForceSet(v8String(info.GetIsolate(), rowList->columnNames()[i]), v
alue, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); |
88 } | 88 } |
89 | 89 |
90 v8SetReturnValue(info, item); | 90 v8SetReturnValue(info, item); |
91 } | 91 } |
92 | 92 |
93 } // namespace blink | 93 } // namespace blink |
OLD | NEW |