OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2007, 2008, 2009 Google, Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008, 2009 Google, Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 v8::Handle<v8::Value> argv[] = { obj }; | 529 v8::Handle<v8::Value> argv[] = { obj }; |
530 v8::Local<v8::Value> propsObj = enumerator->Call(v8::Handle<v8::Object>:
:Cast(enumeratorObj), ARRAYSIZE_UNSAFE(argv), argv); | 530 v8::Local<v8::Value> propsObj = enumerator->Call(v8::Handle<v8::Object>:
:Cast(enumeratorObj), ARRAYSIZE_UNSAFE(argv), argv); |
531 if (propsObj.IsEmpty()) | 531 if (propsObj.IsEmpty()) |
532 return false; | 532 return false; |
533 | 533 |
534 // Convert the results into an array of NPIdentifiers. | 534 // Convert the results into an array of NPIdentifiers. |
535 v8::Handle<v8::Array> props = v8::Handle<v8::Array>::Cast(propsObj); | 535 v8::Handle<v8::Array> props = v8::Handle<v8::Array>::Cast(propsObj); |
536 *count = props->Length(); | 536 *count = props->Length(); |
537 *identifier = static_cast<NPIdentifier*>(malloc(sizeof(NPIdentifier*) *
*count)); | 537 *identifier = static_cast<NPIdentifier*>(malloc(sizeof(NPIdentifier*) *
*count)); |
538 for (uint32_t i = 0; i < *count; ++i) { | 538 for (uint32_t i = 0; i < *count; ++i) { |
539 v8::Local<v8::Value> name = props->Get(v8Integer(i, context->GetIsol
ate())); | 539 v8::Local<v8::Value> name = props->Get(deprecatedV8Integer(i)); |
540 (*identifier)[i] = getStringIdentifier(v8::Local<v8::String>::Cast(n
ame)); | 540 (*identifier)[i] = getStringIdentifier(v8::Local<v8::String>::Cast(n
ame)); |
541 } | 541 } |
542 return true; | 542 return true; |
543 } | 543 } |
544 | 544 |
545 if (NP_CLASS_STRUCT_VERSION_HAS_ENUM(npObject->_class) && npObject->_class->
enumerate) | 545 if (NP_CLASS_STRUCT_VERSION_HAS_ENUM(npObject->_class) && npObject->_class->
enumerate) |
546 return npObject->_class->enumerate(npObject, identifier, count); | 546 return npObject->_class->enumerate(npObject, identifier, count); |
547 | 547 |
548 return false; | 548 return false; |
549 } | 549 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 | 583 |
584 convertV8ObjectToNPVariant(resultObject, npObject, result); | 584 convertV8ObjectToNPVariant(resultObject, npObject, result); |
585 return true; | 585 return true; |
586 } | 586 } |
587 | 587 |
588 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class->
construct) | 588 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class->
construct) |
589 return npObject->_class->construct(npObject, arguments, argumentCount, r
esult); | 589 return npObject->_class->construct(npObject, arguments, argumentCount, r
esult); |
590 | 590 |
591 return false; | 591 return false; |
592 } | 592 } |
OLD | NEW |