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 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 if (npObject->_class->hasMethod) | 504 if (npObject->_class->hasMethod) |
505 return npObject->_class->hasMethod(npObject, methodName); | 505 return npObject->_class->hasMethod(npObject, methodName); |
506 return false; | 506 return false; |
507 } | 507 } |
508 | 508 |
509 void _NPN_SetException(NPObject* npObject, const NPUTF8 *message) | 509 void _NPN_SetException(NPObject* npObject, const NPUTF8 *message) |
510 { | 510 { |
511 if (!npObject || !npObjectToV8NPObject(npObject)) { | 511 if (!npObject || !npObjectToV8NPObject(npObject)) { |
512 // We won't be able to find a proper scope for this exception, so just t
hrow it. | 512 // We won't be able to find a proper scope for this exception, so just t
hrow it. |
513 // This is consistent with JSC, which throws a global exception all the
time. | 513 // This is consistent with JSC, which throws a global exception all the
time. |
514 V8ThrowException::throwGeneralError(message, v8::Isolate::GetCurrent()); | 514 V8ThrowException::throwGeneralError(v8::Isolate::GetCurrent(), message); |
515 return; | 515 return; |
516 } | 516 } |
517 | 517 |
518 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 518 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
519 ScriptState* scriptState = mainWorldScriptState(isolate, 0, npObject); | 519 ScriptState* scriptState = mainWorldScriptState(isolate, 0, npObject); |
520 if (!scriptState) | 520 if (!scriptState) |
521 return; | 521 return; |
522 | 522 |
523 ScriptState::Scope scope(scriptState); | 523 ScriptState::Scope scope(scriptState); |
524 ExceptionCatcher exceptionCatcher; | 524 ExceptionCatcher exceptionCatcher; |
525 | 525 |
526 V8ThrowException::throwGeneralError(message, isolate); | 526 V8ThrowException::throwGeneralError(isolate, message); |
527 } | 527 } |
528 | 528 |
529 bool _NPN_Enumerate(NPP npp, NPObject* npObject, NPIdentifier** identifier, uint
32_t* count) | 529 bool _NPN_Enumerate(NPP npp, NPObject* npObject, NPIdentifier** identifier, uint
32_t* count) |
530 { | 530 { |
531 if (!npObject) | 531 if (!npObject) |
532 return false; | 532 return false; |
533 | 533 |
534 if (V8NPObject* object = npObjectToV8NPObject(npObject)) { | 534 if (V8NPObject* object = npObjectToV8NPObject(npObject)) { |
535 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 535 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
536 ScriptState* scriptState = mainWorldScriptState(isolate, npp, npObject); | 536 ScriptState* scriptState = mainWorldScriptState(isolate, npp, npObject); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 | 614 |
615 convertV8ObjectToNPVariant(resultObject, npObject, result, isolate); | 615 convertV8ObjectToNPVariant(resultObject, npObject, result, isolate); |
616 return true; | 616 return true; |
617 } | 617 } |
618 | 618 |
619 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class->
construct) | 619 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class->
construct) |
620 return npObject->_class->construct(npObject, arguments, argumentCount, r
esult); | 620 return npObject->_class->construct(npObject, arguments, argumentCount, r
esult); |
621 | 621 |
622 return false; | 622 return false; |
623 } | 623 } |
OLD | NEW |