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