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