wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Contact / JSContactWebSiteArray.cpp
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        JSContactWebSiteArray.cpp
20  * @author      Kisub Song (kisubs.song@samsung.com)
21  * @version     0.1
22  * @brief
23  */
24
25 #include <algorithm>
26 #include <CommonsJavaScript/ScopedJSStringRef.h>
27 #include <JSTizenExceptionFactory.h>
28 #include <JSTizenException.h>
29 #include "ContactConverter.h"
30 #include "JSContactWebSiteArray.h"
31 #include <Logger.h>
32
33 #define FUNCTION_CONCAT "concat"
34 #define FUNCTION_JOIN "join"
35 #define FUNCTION_POP "pop"
36 #define FUNCTION_PUSH "push"
37 #define FUNCTION_REVERSE "reverse"
38 #define FUNCTION_SHIFT "shift"
39 #define FUNCTION_SLICE "slice"
40 #define FUNCTION_SORT "sort"
41 #define FUNCTION_SPLICE "splice"
42 #define FUNCTION_TOSTRING "toString"
43 #define FUNCTION_UNSHIFT "unshift"
44 #define FUNCTION_VALUEOF "valueOf"
45 #define ARRAY "Array"
46 #define ATTRIBUTE_LENGTH "length"
47
48 namespace DeviceAPI {
49 namespace Contact {
50
51 using namespace DeviceAPI::Common;
52 using namespace WrtDeviceApis::CommonsJavaScript;
53
54 JSClassDefinition JSContactWebSiteArray::m_classInfo = {
55         0,
56         kJSClassAttributeNone,
57         ARRAY,
58         0,
59         m_property,
60         m_function,
61         initialize,
62         finalize,
63         hasProperty,
64         getProperty,
65         setProperty,
66         deleteProperty,
67         getPropertyNames,
68         NULL, //callAsFunction,
69         NULL, //callAsConstructor,
70         NULL, //hasInstance,
71         NULL, //convertToType,
72 };
73
74 JSStaticValue JSContactWebSiteArray::m_property[] = {
75         { ATTRIBUTE_LENGTH, getLength, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
76         { 0, 0, 0, 0 }
77 };
78
79 JSStaticFunction JSContactWebSiteArray::m_function[] = {
80         { FUNCTION_CONCAT, concat, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
81         { FUNCTION_JOIN, join, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
82         { FUNCTION_POP, pop, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
83         { FUNCTION_PUSH, push, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
84         { FUNCTION_REVERSE, reverse, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
85         { FUNCTION_SHIFT, shift, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
86         { FUNCTION_SLICE, slice, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
87         { FUNCTION_SORT, sort, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
88         { FUNCTION_SPLICE, splice, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
89         { FUNCTION_TOSTRING, toString, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
90         { FUNCTION_UNSHIFT, unshift, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
91         { FUNCTION_VALUEOF, valueOf, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete },
92         { 0, 0, 0 }
93 };
94
95 JSClassRef JSContactWebSiteArray::m_jsClassRef = JSClassCreate(
96                 JSContactWebSiteArray::getClassInfo());
97
98 JSValueRef JSContactWebSiteArray::getLength(JSContextRef context,
99                 JSObjectRef object,
100                 JSStringRef propertyName,
101                 JSValueRef* exception)
102 {
103         Try
104         {
105                 JSContactWebSiteArrayPriv* priv =
106                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(object));
107                 if (!priv) {
108                         Throw(WrtDeviceApis::Commons::NullPointerException);
109                 }
110                 ContactWebSiteArrayPtr webSites = priv->getObject();
111                 if (webSites) {
112                         ContactConverterFactory::ConverterType converter =
113                                         ContactConverterFactory::getConverter(context);
114                         return converter->toJSValueRef(webSites->size());
115                 }
116         }
117         Catch(WrtDeviceApis::Commons::Exception)
118         {
119                 LoggerE("invalid conversion");
120         }
121         return JSValueMakeUndefined(context);
122 }
123
124 bool JSContactWebSiteArray::isObjectOfClass(JSContextRef context, JSValueRef value)
125 {
126         return JSValueIsObjectOfClass(context, value, getClassRef());
127 }
128
129 ContactWebSiteArrayPtr JSContactWebSiteArray::getContactWebSiteArray(JSContextRef context, JSValueRef value)
130 {
131         if (!isObjectOfClass(context, value)) {
132                 Throw(WrtDeviceApis::Commons::InvalidArgumentException);
133         }
134         JSObjectRef object = JSValueToObject(context, value, NULL);
135         if (!object) {
136                 Throw(WrtDeviceApis::Commons::InvalidArgumentException);
137         }
138         JSContactWebSiteArrayPriv *priv = static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(object));
139         if (!priv) {
140                 Throw(WrtDeviceApis::Commons::NullPointerException);
141         }
142         return priv->getObject();
143 }
144
145 JSObjectRef JSContactWebSiteArray::createArray(JSContextRef context,
146                 const ContactWebSiteArrayPtr &webSites)
147 {
148         JSContactWebSiteArrayPriv *priv = new JSContactWebSiteArrayPriv(context, webSites);
149         return JSObjectMake(context, getClassRef(), priv);
150 }
151
152 const JSClassDefinition* JSContactWebSiteArray::getClassInfo()
153 {
154         return &(m_classInfo);
155 }
156
157 JSClassRef JSContactWebSiteArray::getClassRef()
158 {
159         if (!m_jsClassRef) {
160                 m_jsClassRef = JSClassCreate(&m_classInfo);
161         }
162         return m_jsClassRef;
163 }
164
165 void JSContactWebSiteArray::initialize(JSContextRef context,
166                 JSObjectRef object)
167 {
168 }
169
170 void JSContactWebSiteArray::finalize(JSObjectRef object)
171 {
172         JSContactWebSiteArrayPriv* priv =
173                 static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(object));
174         delete priv;
175         JSObjectSetPrivate(object, NULL);
176 }
177
178 bool JSContactWebSiteArray::hasProperty(JSContextRef context,
179                 JSObjectRef object,
180                 JSStringRef propertyName)
181 {
182         ContactConverterFactory::ConverterType converter =
183                         ContactConverterFactory::getConverter(context);
184         Try
185         {
186                 size_t index = converter->toSizeT(propertyName);
187                 JSContactWebSiteArrayPriv* priv =
188                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(object));
189                 if (!priv) {
190                         Throw(WrtDeviceApis::Commons::NullPointerException);
191                 }
192                 ContactWebSiteArrayPtr webSites = priv->getObject();
193                 if (index < webSites->size()) {
194                         return true;
195                 }
196         }
197         Catch(WrtDeviceApis::Commons::Exception)
198         {
199                 //not reporting error is intended
200         }
201         return false;
202 }
203
204 JSValueRef JSContactWebSiteArray::getProperty(JSContextRef context,
205                 JSObjectRef object,
206                 JSStringRef propertyName,
207                 JSValueRef* exception)
208 {
209         ContactConverterFactory::ConverterType converter =
210                         ContactConverterFactory::getConverter(context);
211         Try
212         {
213                 size_t index = converter->toSizeT(propertyName);
214                 JSContactWebSiteArrayPriv* priv =
215                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(object));
216                 if (!priv) {
217                         Throw(WrtDeviceApis::Commons::NullPointerException);
218                 }
219                 ContactWebSiteArrayPtr webSites = priv->getObject();
220                 if (index < webSites->size()) {
221                         ContactWebSitePtr result = webSites->at(index);
222                         if (result) {
223                                 return converter->toJSValueRef(result);
224                         }
225                 }
226         }
227         Catch(WrtDeviceApis::Commons::Exception)
228         {
229                 LoggerE("invalid property");
230         }
231         return JSValueMakeUndefined(context);
232 }
233
234 bool JSContactWebSiteArray::setProperty(JSContextRef context,
235                 JSObjectRef object,
236                 JSStringRef propertyName,
237                 JSValueRef value,
238                 JSValueRef* exception)
239 {
240         ContactConverterFactory::ConverterType converter =
241                         ContactConverterFactory::getConverter(context);
242         Try
243         {
244                 size_t index = converter->toSizeT(propertyName);
245                 ContactWebSitePtr webSite(NULL);
246                 if (!JSValueIsUndefined(context, value)) {
247                         webSite = converter->toContactWebSite(value);
248                 }
249                 JSContactWebSiteArrayPriv* priv =
250                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(object));
251                 if (!priv) {
252                         Throw(WrtDeviceApis::Commons::NullPointerException);
253                 }
254                 ContactWebSiteArrayPtr webSites = priv->getObject();
255                 if (!webSites) {
256                         Throw(WrtDeviceApis::Commons::NullPointerException);
257                 }
258                 if (webSites->size() <= index) {
259                         webSites->resize(index + 1);
260                 }
261                 (*webSites)[index] = webSite;
262                 return true;
263         }
264         Catch(WrtDeviceApis::Commons::Exception)
265         {
266                 LoggerE("error occured");
267                 JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
268         }
269         return false;
270 }
271
272 bool JSContactWebSiteArray::deleteProperty(JSContextRef context,
273                 JSObjectRef object,
274                 JSStringRef propertyName,
275                 JSValueRef* exception)
276 {
277         ContactConverterFactory::ConverterType converter =
278                         ContactConverterFactory::getConverter(context);
279         Try
280         {
281                 size_t index = converter->toSizeT(propertyName);
282                 ContactWebSitePtr webSite(NULL);
283                 JSContactWebSiteArrayPriv* priv =
284                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(object));
285                 if (!priv) {
286                         Throw(WrtDeviceApis::Commons::NullPointerException);
287                 }
288                 ContactWebSiteArrayPtr webSites = priv->getObject();
289                 if (!webSites) {
290                         Throw(WrtDeviceApis::Commons::NullPointerException);
291                 }
292                 if (webSites->size() > index) {
293                         (*webSites)[index] = webSite;
294                 }
295                 return true;
296         }
297         Catch(WrtDeviceApis::Commons::Exception)
298         {
299                 LoggerE("error occured");
300                 JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
301         }
302         return false;
303 }
304
305 void JSContactWebSiteArray::getPropertyNames(JSContextRef context,
306                 JSObjectRef object,
307                 JSPropertyNameAccumulatorRef propertyNames)
308 {
309         ContactConverterFactory::ConverterType converter =
310                         ContactConverterFactory::getConverter(context);
311         Try
312         {
313                 JSContactWebSiteArrayPriv* priv =
314                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(object));
315                 if (!priv) {
316                         Throw(WrtDeviceApis::Commons::NullPointerException);
317                 }
318                 ContactWebSiteArrayPtr webSites = priv->getObject();
319
320                 int count = webSites->size();
321
322                 for(int i=0; i < count; i++)
323                 {
324                         ScopedJSStringRef name(converter->toJSStringRef(converter->toString(i)));
325                         JSPropertyNameAccumulatorAddName(propertyNames, name.get());
326                 }
327         }
328         Catch(WrtDeviceApis::Commons::Exception)
329         {
330                 LoggerE("invalid property");
331         }
332 }
333
334 JSValueRef JSContactWebSiteArray::concat(JSContextRef context,
335                 JSObjectRef function,
336                 JSObjectRef thisObject,
337                 size_t argumentCount,
338                 const JSValueRef arguments[],
339                 JSValueRef* exception)
340 {
341         Try
342         {
343                 ContactWebSiteArrayPtr webSites = ContactWebSiteArrayPtr(new ContactWebSiteArray());
344                 JSContactWebSiteArrayPriv *newPrivateObject = new JSContactWebSiteArrayPriv(context, webSites);
345                 JSValueRef result = JSObjectMake(context, getClassRef(), newPrivateObject);
346
347                 //copy current webSites
348                 JSContactWebSiteArrayPriv* priv =
349                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(thisObject));
350                 ContactWebSiteArrayPtr currentWebSites = priv->getObject();
351                 for (size_t i = 0; i < currentWebSites->size(); ++i) {
352                         webSites->push_back(currentWebSites->at(i));
353                 }
354
355                 //copy submitted arrays
356                 ContactConverterFactory::ConverterType converter =
357                                 ContactConverterFactory::getConverter(context);
358                 for (size_t i = 0; i < argumentCount; ++i) {
359                         if (!JSIsArrayValue(context, arguments[i])) {
360                                 Throw(WrtDeviceApis::Commons::ConversionException);
361                         }
362                         // process array of strings
363                         JSObjectRef arrayObj = converter->toJSObjectRef(arguments[i]);
364                         unsigned int len = JSGetArrayLength(context, arrayObj);
365                         for (unsigned int e = 0; e < len; ++e) {
366                                 JSValueRef att = JSGetArrayElement(context, arrayObj, e);
367                                 webSites->push_back(converter->toContactWebSite(att));
368                         }
369                 }
370                 return result;
371         }
372         Catch(WrtDeviceApis::Commons::Exception)
373         {
374                 LoggerE("error occured");
375         }
376         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
377 }
378
379 JSValueRef JSContactWebSiteArray::join(JSContextRef context,
380                 JSObjectRef function,
381                 JSObjectRef thisObject,
382                 size_t argumentCount,
383                 const JSValueRef arguments[],
384                 JSValueRef* exception)
385 {
386         Try
387         {
388                 std::string result;
389                 std::string separator(",");
390                 ContactConverterFactory::ConverterType converter =
391                                 ContactConverterFactory::getConverter(context);
392                 JSContactWebSiteArrayPriv* priv =
393                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(thisObject));
394                 ContactWebSiteArrayPtr currentWebSites = priv->getObject();
395                 if (argumentCount > 0 && JSValueIsString(context, arguments[0])) {
396                         separator = converter->toString(arguments[0]);
397                 }
398                 for (size_t i = 0; i < currentWebSites->size(); ++i) {
399                         if (i != 0) {
400                                 result += separator;
401                         }
402                         //FIXME : to be changed to support join
403                         //result += currentWebSites->at(i);
404                 }
405                 return converter->toJSValueRef(result);
406         }
407         Catch(WrtDeviceApis::Commons::Exception)
408         {
409                 LoggerE("error occured");
410         }
411         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
412 }
413
414 JSValueRef JSContactWebSiteArray::pop(JSContextRef context,
415                 JSObjectRef function,
416                 JSObjectRef thisObject,
417                 size_t argumentCount,
418                 const JSValueRef arguments[],
419                 JSValueRef* exception)
420 {
421         Try
422         {
423                 ContactConverterFactory::ConverterType converter =
424                                 ContactConverterFactory::getConverter(context);
425                 JSContactWebSiteArrayPriv* priv =
426                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(thisObject));
427                 ContactWebSiteArrayPtr currentWebSites = priv->getObject();
428                 if (currentWebSites->size() > 0) {
429                         ContactWebSitePtr result = currentWebSites->at(
430                                         currentWebSites->size() - 1);
431                         currentWebSites->pop_back();
432                         return converter->toJSValueRef(result);
433                 }
434         }
435         Catch(WrtDeviceApis::Commons::Exception)
436         {
437                 LoggerE("error occured");
438         }
439         return JSValueMakeUndefined(context);
440 }
441
442 JSValueRef JSContactWebSiteArray::push(JSContextRef context,
443                 JSObjectRef function,
444                 JSObjectRef thisObject,
445                 size_t argumentCount,
446                 const JSValueRef arguments[],
447                 JSValueRef* exception)
448 {
449         Try
450         {
451                 ContactConverterFactory::ConverterType converter =
452                                 ContactConverterFactory::getConverter(context);
453                 JSContactWebSiteArrayPriv* priv =
454                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(thisObject));
455                 ContactWebSiteArrayPtr currentWebSites = priv->getObject();
456                 for (size_t i = 0; i < argumentCount; ++i) {
457                         currentWebSites->push_back(converter->toContactWebSite(arguments[i]));
458                 }
459                 return converter->toJSValueRef(currentWebSites->size());
460         }
461         Catch(WrtDeviceApis::Commons::Exception)
462         {
463                 LoggerE("error occured");
464         }
465         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
466 }
467
468 JSValueRef JSContactWebSiteArray::reverse(JSContextRef context,
469                 JSObjectRef function,
470                 JSObjectRef thisObject,
471                 size_t argumentCount,
472                 const JSValueRef arguments[],
473                 JSValueRef* exception)
474 {
475         Try
476         {
477                 ContactConverterFactory::ConverterType converter =
478                                 ContactConverterFactory::getConverter(context);
479                 JSContactWebSiteArrayPriv* priv =
480                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(thisObject));
481                 ContactWebSiteArrayPtr currentWebSites = priv->getObject();
482                 std::reverse(currentWebSites->begin(), currentWebSites->end());
483                 return thisObject;
484         }
485         Catch(WrtDeviceApis::Commons::Exception)
486         {
487                 LoggerE("error occured");
488         }
489         return JSValueMakeUndefined(context);
490 }
491
492 JSValueRef JSContactWebSiteArray::shift(JSContextRef context,
493                 JSObjectRef function,
494                 JSObjectRef thisObject,
495                 size_t argumentCount,
496                 const JSValueRef arguments[],
497                 JSValueRef* exception)
498 {
499         Try
500         {
501                 ContactConverterFactory::ConverterType converter =
502                                 ContactConverterFactory::getConverter(context);
503                 JSContactWebSiteArrayPriv* priv =
504                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(thisObject));
505                 ContactWebSiteArrayPtr currentWebSites = priv->getObject();
506                 if (currentWebSites->size() > 0) {
507                         ContactWebSitePtr result = currentWebSites->at(0);
508                         currentWebSites->erase(currentWebSites->begin());
509                         return converter->toJSValueRef(result);
510                 }
511         }
512         Catch(WrtDeviceApis::Commons::Exception)
513         {
514                 LoggerE("error occured");
515         }
516         return JSValueMakeUndefined(context);
517 }
518
519 JSValueRef JSContactWebSiteArray::slice(JSContextRef context,
520                 JSObjectRef function,
521                 JSObjectRef thisObject,
522                 size_t argumentCount,
523                 const JSValueRef arguments[],
524                 JSValueRef* exception)
525 {
526         Try
527         {
528                 if (argumentCount < 1) {
529                         return JSValueMakeUndefined(context);
530                 }
531                 ContactConverterFactory::ConverterType converter =
532                                 ContactConverterFactory::getConverter(context);
533                 ContactWebSiteArrayPtr webSites = ContactWebSiteArrayPtr(new ContactWebSiteArray());
534                 JSContactWebSiteArrayPriv *newPrivateObject = new JSContactWebSiteArrayPriv(
535                                 context,
536                                 webSites);
537                 JSValueRef result = JSObjectMake(context,
538                                                                                  getClassRef(), newPrivateObject);
539
540                 //copy current webSites
541                 JSContactWebSiteArrayPriv* priv =
542                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(thisObject));
543                 ContactWebSiteArrayPtr currentWebSites = priv->getObject();
544                 std::size_t first = converter->toSizeT(arguments[0]);
545                 std::size_t last = currentWebSites->size() - 1;
546                 if (argumentCount > 1) {
547                         last = converter->toSizeT(arguments[1]);
548                         if (last >= currentWebSites->size()) {
549                                 last = currentWebSites->size() - 1;
550                         }
551                 }
552                 for (size_t i = first; i <= last; ++i) {
553                         webSites->push_back(currentWebSites->at(i));
554                 }
555
556                 return result;
557         }
558         Catch(WrtDeviceApis::Commons::Exception)
559         {
560                 LoggerE("error occured");
561         }
562         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
563 }
564
565 JSValueRef JSContactWebSiteArray::sort(JSContextRef context,
566                 JSObjectRef function,
567                 JSObjectRef thisObject,
568                 size_t argumentCount,
569                 const JSValueRef arguments[],
570                 JSValueRef* exception)
571 {
572         Try
573         {
574                 ContactConverterFactory::ConverterType converter =
575                                 ContactConverterFactory::getConverter(context);
576                 JSContactWebSiteArrayPriv* priv =
577                         static_cast<JSContactWebSiteArrayPriv*>(JSObjectGetPrivate(thisObject));
578                 ContactWebSiteArrayPtr currentWebSites = priv->getObject();
579                 std::sort(currentWebSites->begin(), currentWebSites->end());
580                 return thisObject;
581         }
582         Catch(WrtDeviceApis::Commons::Exception)
583         {
584                 LoggerE("error occured");
585         }
586         return JSValueMakeUndefined(context);
587 }
588
589 JSValueRef JSContactWebSiteArray::splice(JSContextRef context,
590                 JSObjectRef function,
591                 JSObjectRef thisObject,
592                 size_t argumentCount,
593                 const JSValueRef arguments[],
594                 JSValueRef* exception)
595 {
596         return JSValueMakeUndefined(context);
597 }
598
599 JSValueRef JSContactWebSiteArray::toString(JSContextRef context,
600                 JSObjectRef function,
601                 JSObjectRef thisObject,
602                 size_t argumentCount,
603                 const JSValueRef arguments[],
604                 JSValueRef* exception)
605 {
606         return join(context, function, thisObject, 0, arguments, exception);
607 }
608
609 JSValueRef JSContactWebSiteArray::unshift(JSContextRef context,
610                 JSObjectRef function,
611                 JSObjectRef thisObject,
612                 size_t argumentCount,
613                 const JSValueRef arguments[],
614                 JSValueRef* exception)
615 {
616         return JSValueMakeUndefined(context);
617 }
618
619 JSValueRef JSContactWebSiteArray::valueOf(JSContextRef context,
620                 JSObjectRef function,
621                 JSObjectRef thisObject,
622                 size_t argumentCount,
623                 const JSValueRef arguments[],
624                 JSValueRef* exception)
625 {
626         return JSValueMakeUndefined(context);
627 }
628
629 } // Contact
630 } // DeviceAPI