2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <dpl/log/log.h>
18 #include <Tizen/Common/JSTizenExceptionFactory.h>
19 #include <Tizen/Common/JSTizenException.h>
20 #include "JSNdefRecordArray.h"
21 #include "JSNdefMessage.h"
22 #include "NFCConverter.h"
23 #include <API/NFC/NFCFactory.h>
26 const char* FUNCTION_CONCAT = "concat";
27 const char* FUNCTION_JOIN = "join";
28 const char* FUNCTION_POP = "pop";
29 const char* FUNCTION_PUSH = "push";
30 const char* FUNCTION_REVERSE = "reverse";
31 const char* FUNCTION_SHIFT = "shift";
32 const char* FUNCTION_SLICE = "slice";
33 const char* FUNCTION_SORT = "sort";
34 const char* FUNCTION_SPLICE = "splice";
35 const char* FUNCTION_TOSTRING = "toString";
36 const char* FUNCTION_UNSHIFT = "unshift";
37 const char* FUNCTION_VALUEOF = "valueOf";
38 const char *ARRAY = "Array";
39 const char *ATTRIBUTE_LENGTH = "length";
44 using namespace TizenApis::Commons;
45 using namespace Api::NFC;
46 using namespace WrtDeviceApis;
47 using namespace WrtDeviceApis::Commons;
48 using namespace WrtDeviceApis::CommonsJavaScript;
50 JSClassDefinition JSNdefRecordArray::m_classInfo = {
52 kJSClassAttributeNone,
62 NULL, //deleteProperty,
63 NULL, //getPropertyNames,
64 NULL, //callAsFunction,
65 NULL, //callAsConstructor,
67 NULL, //convertToType,
70 JSStaticValue JSNdefRecordArray::m_property[] = {
71 { ATTRIBUTE_LENGTH, getLength, NULL, kJSPropertyAttributeReadOnly },
75 JSStaticFunction JSNdefRecordArray::m_function[] = {
76 { FUNCTION_CONCAT, concat, kJSPropertyAttributeNone },
77 { FUNCTION_JOIN, join, kJSPropertyAttributeNone },
78 { FUNCTION_POP, pop, kJSPropertyAttributeNone },
79 { FUNCTION_PUSH, push, kJSPropertyAttributeNone },
80 { FUNCTION_REVERSE, reverse, kJSPropertyAttributeNone },
81 { FUNCTION_SHIFT, shift, kJSPropertyAttributeNone },
82 { FUNCTION_SLICE, slice, kJSPropertyAttributeNone },
83 { FUNCTION_SORT, sort, kJSPropertyAttributeNone },
84 { FUNCTION_SPLICE, splice, kJSPropertyAttributeNone },
85 { FUNCTION_TOSTRING, toString, kJSPropertyAttributeNone },
86 { FUNCTION_UNSHIFT, unshift, kJSPropertyAttributeNone },
87 { FUNCTION_VALUEOF, valueOf, kJSPropertyAttributeNone },
91 JSClassRef JSNdefRecordArray::m_jsClassRef = JSClassCreate(
92 JSNdefRecordArray::getClassInfo());
94 JSValueRef JSNdefRecordArray::getLength(JSContextRef context,
96 JSStringRef propertyName,
97 JSValueRef* exception)
102 NdefMessagePrivObject* priv =
103 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(object));
105 Throw(NullPointerException);
107 INdefMessagePtr privateDatas = priv->getObject();
109 Converter converter(context);
110 return converter.toJSValueRefLong(privateDatas->getRecordCount());
113 Catch(WrtDeviceApis::Commons::Exception)
115 LogError("invalid conversion");
117 return JSValueMakeUndefined(context);
120 JSObjectRef JSNdefRecordArray::createArray(JSContextRef context,
121 const INdefMessagePtr &privateDatas)
124 NdefMessagePrivObject *priv = new NdefMessagePrivObject(context, privateDatas);
125 return JSObjectMake(context, getClassRef(), priv);
128 const JSClassDefinition* JSNdefRecordArray::getClassInfo()
130 return &(m_classInfo);
133 JSClassRef JSNdefRecordArray::getClassRef()
136 m_jsClassRef = JSClassCreate(&m_classInfo);
141 bool JSNdefRecordArray::isObjectOfClass(JSContextRef context, JSValueRef value)
143 return JSValueIsObjectOfClass(context, value, getClassRef());
147 JSNdefRecordArray::getNdefRecordArray(JSContextRef context, JSValueRef value)
150 if (!isObjectOfClass(context, value)) {
151 Throw(InvalidArgumentException);
153 JSObjectRef object = JSValueToObject(context, value, NULL);
155 Throw(InvalidArgumentException);
157 NdefMessagePrivObject *priv = static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(object));
159 Throw(NullPointerException);
161 return priv->getObject();
164 void JSNdefRecordArray::initialize(JSContextRef context,
170 void JSNdefRecordArray::finalize(JSObjectRef object)
172 NdefMessagePrivObject* priv =
173 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(object));
175 JSObjectSetPrivate(object, NULL);
178 bool JSNdefRecordArray::hasProperty(JSContextRef context,
180 JSStringRef propertyName)
183 Converter converter(context);
186 size_t index = converter.toSizeT(propertyName);
187 NdefMessagePrivObject* priv =
188 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(object));
190 Throw(NullPointerException);
192 INdefMessagePtr privateDatas = priv->getObject();
193 if (static_cast<long>(index) < privateDatas->getRecordCount()) {
197 Catch(WrtDeviceApis::Commons::Exception)
199 //not reporting error is intended
204 JSValueRef JSNdefRecordArray::getProperty(JSContextRef context,
206 JSStringRef propertyName,
207 JSValueRef* exception)
213 NdefMessagePrivObject* priv =
214 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(object));
216 Throw(NullPointerException);
219 NFCConverter converter(priv->getContext());
220 size_t index = converter.toSizeT(propertyName);
222 INdefMessagePtr privateDatas = priv->getObject();
223 if (static_cast<long>(index) < privateDatas->getRecordCount()) {
224 NdefRecordData result = privateDatas->getNDEFRecord(index);
225 return converter.toJSValueRef(result);
228 Catch(WrtDeviceApis::Commons::Exception)
230 LogError("invalid property");
232 return JSValueMakeUndefined(context);
235 bool JSNdefRecordArray::setProperty(JSContextRef context,
237 JSStringRef propertyName,
239 JSValueRef* exception)
242 NFCConverter converter(context);
245 size_t index = converter.toSizeT(propertyName);
246 NdefMessagePrivObject* priv =
247 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(object));
249 Throw(NullPointerException);
251 INdefMessagePtr privateDatas = priv->getObject();
253 Throw(NullPointerException);
255 void *record = converter.getRecordHandle(value);
256 if (privateDatas->getRecordCount() == static_cast<long>(index)) {
257 privateDatas->appendNDEFRecord(record);
258 } else if (privateDatas->getRecordCount() > static_cast<long>(index)) {
259 privateDatas->removeNDEFRecord(static_cast<long>(index));
260 privateDatas->insertNDEFRecord(static_cast<long>(index), record);
262 Throw(InvalidArgumentException);
265 } Catch (NullPointerException) {
266 LogError("NullPointerException: " << _rethrown_exception.GetMessage());
267 *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
268 } Catch (ConversionException) {
269 LogError("ConversionException: " << _rethrown_exception.GetMessage());
270 *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
271 } Catch (InvalidArgumentException) {
272 LogError("InvalidArgumentException: " << _rethrown_exception.GetMessage());
273 *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
274 } Catch(WrtDeviceApis::Commons::Exception) {
275 LogError("Exception: " << _rethrown_exception.GetMessage());
276 *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
281 JSValueRef JSNdefRecordArray::concat(JSContextRef context,
282 JSObjectRef function,
283 JSObjectRef thisObject,
284 size_t argumentCount,
285 const JSValueRef arguments[],
286 JSValueRef* exception)
291 //copy current privateDatas
292 NdefMessagePrivObject* priv =
293 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(thisObject));
295 LogError("Private object is not set.");
296 ThrowMsg(NullPointerException, "Private object not initialized");
299 INdefMessagePtr myMessage = priv->getObject();
301 INdefMessagePtr NdefMessage = NFCFactory::getInstance().createNDEFMessageObject(myMessage->toByte());
303 if (argumentCount == 0)
304 return createArray(priv->getContext(), NdefMessage);
306 NFCConverter converter(context);
307 for (int i = 0; i < argumentCount; i++) {
308 if (JSIsArrayValue(context, arguments[i])) {
309 std::vector<void *> records = converter.toVectorOfRecordHandles(arguments[i]);
310 for (int j = 0; j < records.size(); j++)
311 NdefMessage->appendNDEFRecord(records[j]);
312 } else if (isObjectOfClass(context, arguments[i])) {
313 NdefMessagePrivObject* argPriv =
314 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(converter.toJSObjectRef(arguments[i])));
316 LogError(i << "record's private object is not set.");
317 ThrowMsg(InvalidArgumentException, "Record's private object not initialized");
319 INdefMessagePtr argMessage = argPriv->getObject();
320 for (long j = 0 ; j < argMessage->getRecordCount(); j++)
321 NdefMessage->appendNDEFRecord(argMessage->getRecordHandle(j));
323 ThrowMsg(ConversionException, "No Array");
326 return createArray(priv->getContext(), NdefMessage);;
327 } Catch(NullPointerException) {
328 LogError("NullPointerException: " << _rethrown_exception.GetMessage());
329 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
330 } Catch(ConversionException) {
331 LogError("ConversionException: " << _rethrown_exception.GetMessage());
332 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
333 } Catch (InvalidArgumentException) {
334 LogError("InvalidArgumentException: " << _rethrown_exception.GetMessage());
335 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
336 } Catch (WrtDeviceApis::Commons::Exception) {
337 LogError("Exception: " << _rethrown_exception.GetMessage());
338 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
341 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
344 JSValueRef JSNdefRecordArray::join(JSContextRef context,
345 JSObjectRef function,
346 JSObjectRef thisObject,
347 size_t argumentCount,
348 const JSValueRef arguments[],
349 JSValueRef* exception)
355 std::string separator(",");
356 NFCConverter converter(context);
357 NdefMessagePrivObject* priv =
358 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(thisObject));
359 INdefMessagePtr myMessage = priv->getObject();
360 if (argumentCount > 0 && JSValueIsString(context, arguments[0])) {
361 separator = converter.toString(arguments[0]);
363 for (size_t i = 0; i < myMessage->getRecordCount(); i++) {
367 result += "[object " + converter.toRecordClassName(myMessage->getNDEFRecord(i)) + "]";
369 return converter.toJSValueRef(result);
371 Catch(WrtDeviceApis::Commons::Exception)
373 LogError("error occured");
375 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
378 JSValueRef JSNdefRecordArray::pop(JSContextRef context,
379 JSObjectRef function,
380 JSObjectRef thisObject,
381 size_t argumentCount,
382 const JSValueRef arguments[],
383 JSValueRef* exception)
388 NdefMessagePrivObject* priv =
389 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(thisObject));
390 INdefMessagePtr myMessage = priv->getObject();
392 NFCConverter converter(priv->getContext());
393 long recordCount = myMessage->getRecordCount();
394 if (recordCount > 0) {
395 NdefRecordData result = myMessage->getNDEFRecord(recordCount - 1);
396 myMessage->removeNDEFRecord(recordCount - 1);
397 return converter.toJSValueRef(result);
399 return JSCreateArrayObject(context, 0, NULL);
400 } Catch(NullPointerException) {
401 LogError("NullPointerException: " << _rethrown_exception.GetMessage());
402 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
403 } Catch(ConversionException) {
404 LogError("ConversionException: " << _rethrown_exception.GetMessage());
405 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
406 } Catch (InvalidArgumentException) {
407 LogError("InvalidArgumentException: " << _rethrown_exception.GetMessage());
408 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
409 } Catch (WrtDeviceApis::Commons::Exception) {
410 LogError("Exception: " << _rethrown_exception.GetMessage());
411 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
413 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
416 JSValueRef JSNdefRecordArray::push(JSContextRef context,
417 JSObjectRef function,
418 JSObjectRef thisObject,
419 size_t argumentCount,
420 const JSValueRef arguments[],
421 JSValueRef* exception)
426 NFCConverter converter(context);
427 NdefMessagePrivObject* priv =
428 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(thisObject));
429 INdefMessagePtr myMessage = priv->getObject();
431 for (size_t i = 0; i < argumentCount; ++i) {
432 void *record = converter.getRecordHandle(arguments[i]);
433 myMessage->appendNDEFRecord(record);
435 return converter.toJSValueRefLong(myMessage->getRecordCount());
437 Catch(WrtDeviceApis::Commons::Exception)
439 LogError("error occured");
441 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
444 JSValueRef JSNdefRecordArray::reverse(JSContextRef context,
445 JSObjectRef function,
446 JSObjectRef thisObject,
447 size_t argumentCount,
448 const JSValueRef arguments[],
449 JSValueRef* exception)
454 NFCConverter converter(context);
455 NdefMessagePrivObject* priv =
456 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(thisObject));
457 INdefMessagePtr myMessage = priv->getObject();
459 long recordCounts = myMessage->getRecordCount();
460 if (recordCounts > 0) {
461 std::vector<void *> records;
462 for (long i = recordCounts; i > 0; i--) {
463 records.push_back(myMessage->getRecordHandle(i-1));
465 myMessage->changeAllRecords(records);
469 Catch(WrtDeviceApis::Commons::Exception)
471 LogError("error occured");
473 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
476 JSValueRef JSNdefRecordArray::shift(JSContextRef context,
477 JSObjectRef function,
478 JSObjectRef thisObject,
479 size_t argumentCount,
480 const JSValueRef arguments[],
481 JSValueRef* exception)
486 NdefMessagePrivObject* priv =
487 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(thisObject));
488 INdefMessagePtr myMessage = priv->getObject();
490 NFCConverter converter(priv->getContext());
491 long recordCount = myMessage->getRecordCount();
492 if (recordCount > 0) {
493 NdefRecordData result = myMessage->getNDEFRecord(0);
494 myMessage->removeNDEFRecord(0);
495 return converter.toJSValueRef(result);
497 return JSCreateArrayObject(context, 0, NULL);
499 Catch(WrtDeviceApis::Commons::Exception)
501 LogError("error occured");
503 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
506 JSValueRef JSNdefRecordArray::slice(JSContextRef context,
507 JSObjectRef function,
508 JSObjectRef thisObject,
509 size_t argumentCount,
510 const JSValueRef arguments[],
511 JSValueRef* exception)
516 if (argumentCount < 1) {
517 return JSValueMakeUndefined(context);
520 NdefMessagePrivObject* priv =
521 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(thisObject));
522 INdefMessagePtr myMessage = priv->getObject();
524 NFCConverter converter(priv->getContext());
525 if (JSValueIsNull(context, arguments[0]) || JSValueIsUndefined(context, arguments[0]) || !JSValueIsNumber(context, arguments[0]))
526 ThrowMsg(ConversionException, "parameter is JSNull/JSUndefined/Not number");
528 if ((argumentCount > 1) && (!JSValueIsNull(context, arguments[1]) && (JSValueIsUndefined(context, arguments[1]) || !JSValueIsNumber(context, arguments[1]))))
529 ThrowMsg(ConversionException, "parameter is JSNull/JSUndefined/Not number");
531 long recordCount = myMessage->getRecordCount();
532 long start = converter.toLong(arguments[0]);
533 long end = recordCount;
534 if ((argumentCount > 1) && !JSValueIsNull(context, arguments[1]))
535 end = converter.toLong(arguments[1]) < recordCount ? converter.toLong(arguments[1]) : recordCount;
538 start = recordCount + start;
541 INdefMessagePtr NdefMessage = NFCFactory::getInstance().createNDEFMessageObject();
542 return createArray(priv->getContext(), NdefMessage);
545 std::vector<void *> sliceRecords;
546 for (long i = start; i < end; i++) {
547 void * record = myMessage->getRecordHandle(i);
548 sliceRecords.push_back(record);
550 INdefMessagePtr NdefMessage = NFCFactory::getInstance().createNDEFMessageObject(sliceRecords);
551 return createArray(priv->getContext(), NdefMessage);
553 Catch(WrtDeviceApis::Commons::Exception)
555 LogError("error occured");
557 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
560 JSValueRef JSNdefRecordArray::sort(JSContextRef context,
561 JSObjectRef function,
562 JSObjectRef thisObject,
563 size_t argumentCount,
564 const JSValueRef arguments[],
565 JSValueRef* exception)
571 JSValueRef JSNdefRecordArray::splice(JSContextRef context,
572 JSObjectRef function,
573 JSObjectRef thisObject,
574 size_t argumentCount,
575 const JSValueRef arguments[],
576 JSValueRef* exception)
580 if (argumentCount < 1) {
581 return JSCreateArrayObject(context, 0, NULL);
584 NdefMessagePrivObject* priv =
585 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(thisObject));
586 INdefMessagePtr myMessage = priv->getObject();
588 NFCConverter converter(priv->getContext());
589 if (JSValueIsNull(context, arguments[0]) || JSValueIsUndefined(context, arguments[0]) || !JSValueIsNumber(context, arguments[0]))
590 ThrowMsg(ConversionException, "parameter is JSNull/JSUndefined/Not number");
592 if ( (argumentCount > 1) && (JSValueIsNull(context, arguments[1]) || JSValueIsUndefined(context, arguments[1]) || !JSValueIsNumber(context, arguments[1])))
593 ThrowMsg(ConversionException, "parameter is JSNull/JSUndefined/Not number");
595 long recordCount = myMessage->getRecordCount();
596 long start = converter.toLong(arguments[0]);
598 if (argumentCount > 1)
599 howmany= converter.toLong(arguments[1]);
602 start = recordCount + start;
606 if ((start + howmany) > recordCount)
607 howmany = recordCount - start;
609 std::vector<void *> spliceRecords;
610 for (long i = 0; i < howmany; i++) {
611 void * record = myMessage->getRecordHandle(i + start);
612 spliceRecords.push_back(record);
614 INdefMessagePtr NdefMessage = NFCFactory::getInstance().createNDEFMessageObject(spliceRecords);
616 result = createArray(priv->getContext(), NdefMessage);
618 result = JSCreateArrayObject(context, 0, NULL);
620 if (argumentCount > 2) {
621 for (long j = 2; j < argumentCount; j++) {
622 void *record = converter.getRecordHandle(arguments[j]);
623 if (start < recordCount)
624 myMessage->appendNDEFRecord(record);
626 myMessage->insertNDEFRecord(start++, record);
630 } Catch(NullPointerException) {
631 LogError("NullPointerException: " << _rethrown_exception.GetMessage());
632 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
633 } Catch(ConversionException) {
634 LogError("ConversionException: " << _rethrown_exception.GetMessage());
635 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
636 } Catch (InvalidArgumentException) {
637 LogError("InvalidArgumentException: " << _rethrown_exception.GetMessage());
638 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
639 } Catch (WrtDeviceApis::Commons::Exception) {
640 LogError("Exception: " << _rethrown_exception.GetMessage());
641 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
643 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
646 JSValueRef JSNdefRecordArray::toString(JSContextRef context,
647 JSObjectRef function,
648 JSObjectRef thisObject,
649 size_t argumentCount,
650 const JSValueRef arguments[],
651 JSValueRef* exception)
654 return join(context, function, thisObject, 0, arguments, exception);
657 JSValueRef JSNdefRecordArray::unshift(JSContextRef context,
658 JSObjectRef function,
659 JSObjectRef thisObject,
660 size_t argumentCount,
661 const JSValueRef arguments[],
662 JSValueRef* exception)
666 NdefMessagePrivObject* priv =
667 static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(thisObject));
668 INdefMessagePtr myMessage = priv->getObject();
670 NFCConverter converter(priv->getContext());
672 if (argumentCount > 0) {
673 for (int i = 0; i < argumentCount; i++) {
674 if (converter.isNdefRecord(arguments[i]) == false)
675 ThrowMsg(ConversionException, "parameter is Not record");
678 for (long i = 0 ; i < argumentCount; i++) {
679 void *record = converter.getRecordHandle(arguments[i]);
680 myMessage->insertNDEFRecord(i, record);
683 return converter.toJSValueRefLong(myMessage->getRecordCount());
685 Catch(WrtDeviceApis::Commons::Exception)
687 LogError("error occured");
689 return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
692 JSValueRef JSNdefRecordArray::valueOf(JSContextRef context,
693 JSObjectRef function,
694 JSObjectRef thisObject,
695 size_t argumentCount,
696 const JSValueRef arguments[],
697 JSValueRef* exception)
700 return join(context, function, thisObject, 0, arguments, exception);