Commit graph

154 commits

Author SHA1 Message Date
Kevin Sawicki
d2b9766886 Use std functions instead of template_util 2017-02-17 09:32:45 -08:00
Kevin Sawicki
f56ec818fb Support 5 argument member function 2017-02-17 09:32:45 -08:00
renaesop
7197368c6d Add Converter<std::map<std::string, T>>::ToV8 2017-02-06 16:54:11 +08:00
Cheng Zhao
400d6c3de5 Merge pull request #8 from electron/set-read-only
Support setting read-only property value
2017-01-16 06:53:42 +09:00
Kevin Sawicki
c78a6fa7d4 Support setting read-only property value 2017-01-12 12:21:23 -08:00
deepak1556
70092b493e create empty handle for null or undefined value 2016-12-07 16:41:45 +05:30
Kevin Sawicki
8155da152f Add back empty handle string 2016-08-10 10:04:04 -07:00
Kevin Sawicki
1dbaec0edd Use ToDetailString for processing error message 2016-08-10 09:34:33 -07:00
Cheng Zhao
fa483e1fe0 Do not set constructor name in SetConstructor 2016-08-02 19:27:58 +09:00
Cheng Zhao
4dbe051494 Pass FunctionTemplate in BuildPrototype 2016-08-02 18:06:20 +09:00
Cheng Zhao
3a7a6efffb GetConstructor should init default constructor 2016-08-02 17:20:41 +09:00
Cheng Zhao
2d26eebca8 Remove the Constructor class 2016-08-02 17:01:19 +09:00
Cheng Zhao
a259d10bcb NewOperatorFactory is not used 2016-08-02 16:20:29 +09:00
Cheng Zhao
0a48af9ff7 Create objects from InstanceTemplate 2016-08-02 16:08:00 +09:00
Cheng Zhao
d55c3c5030 Turn Wrappable into using FunctionTemplate 2016-08-02 15:56:47 +09:00
Cheng Zhao
ab62755a88 Make InitWith virtual 2016-08-02 15:28:09 +09:00
Cheng Zhao
bd20bde1a2 Call the user call Init in Constructor 2016-08-02 15:14:48 +09:00
Cheng Zhao
d9bfe6a49d CHECK is not needed 2016-07-21 16:51:48 +09:00
Cheng Zhao
8a31e2d9c0 Update to API changes of V8 5.2 2016-07-04 15:08:08 +09:00
Cheng Zhao
a1efa28520 Setup v8::MicrotasksScope for callbacks 2016-06-24 14:40:47 +09:00
Cheng Zhao
e75f2aa087 Add converter for std::map 2016-06-13 09:26:48 +09:00
Cheng Zhao
4ad6ecd196 Handle.ToV8 should return Object 2016-05-20 15:38:51 +09:00
Cheng Zhao
ea07d4c6c8 Leak Wrappable's template
Since it is declared as static variable it will be released
automatically when process exits, which causes crashes in
renderer process because the template will then be released
later than V8 is closed.

This commit simply leaks the template so the crash won't happen,
this leak should be fine since leaking resource on exit is not
a bad thing.
2016-05-10 16:07:04 +09:00
Cheng Zhao
0df2d882ea Make Wrappable a template class 2016-04-25 10:17:39 +09:00
Robo
309887c444 use v8::private symbols as identifiers for object properties 2016-03-24 01:32:08 +05:30
Paul Betts
16270fa080 basic_types.h => macros.h 2016-03-07 20:36:14 -08:00
Cheng Zhao
e719eab878 Clear internal field when Wrapper is destroyed 2016-02-02 19:50:27 +08:00
Cheng Zhao
26520c5cf4 Improve error message for type error
Close atom/electron#4307.
2016-02-02 10:10:59 +08:00
Cheng Zhao
a3dcf8ced6 Fix converter for std::set 2015-12-11 21:13:33 +08:00
Cheng Zhao
5e70868fd0 isDestroy => isDestroyed 2015-12-04 19:23:13 +08:00
Cheng Zhao
e859228db1 Do not manually destroy native resources 2015-12-03 15:38:14 +08:00
Cheng Zhao
9398494100 Add Dictionary::Delete 2015-11-11 00:25:10 +08:00
Cheng Zhao
21cda4e7fc Don't return v8::Maybe for std::vector 2015-11-02 20:45:29 +08:00
Cheng Zhao
b7387da085 Check whether key exists in Dictionary::Get 2015-09-10 15:57:30 +08:00
Cheng Zhao
8ca005eb41 Use the new SetWeak in Wrappable 2015-08-27 15:55:48 +08:00
Cheng Zhao
f5e34deb1a Add SetHidden for Dictionary 2015-08-27 15:21:27 +08:00
Cheng Zhao
b41635e809 Don't pass callback as const reference 2015-08-13 12:07:35 +08:00
Cheng Zhao
24d31e2046 Don't convert Function to Dictionary 2015-08-12 21:31:45 +08:00
Cheng Zhao
7160054927 GetNext should have no side effect when failed 2015-08-12 21:31:31 +08:00
Cheng Zhao
b6c353ee80 Add Dictionary::CreateEmpty 2015-08-12 21:18:59 +08:00
Cheng Zhao
67d9eaa215 Remove locker.h 2015-08-07 19:32:27 +08:00
Cheng Zhao
ebcf4c0224 Remove callback.h 2015-08-07 18:09:37 +08:00
Cheng Zhao
656e403f01 Use C++11 version of CreateFunctionTemplate 2015-07-23 14:59:32 +08:00
Cheng Zhao
41cd6d13c9 Allow specify methods that can be called after object is destroyed 2015-07-06 21:25:55 +08:00
Cheng Zhao
7b9926807d Add IsDestroyed method for Wrappable 2015-07-06 18:16:57 +08:00
Cheng Zhao
cc4e2fcd94 Check for null when converting Wrappable 2015-06-24 16:35:37 +08:00
Cheng Zhao
cad1fa50a9 Make isolate() public 2015-06-23 17:13:02 +08:00
Cheng Zhao
0586822808 Remember isolate in Wrappable 2015-06-23 17:09:20 +08:00
Cheng Zhao
f310222ce1 Allow converting Array 2015-06-10 11:14:42 +08:00
Cheng Zhao
ad207eeabb Enter context before calling callback 2015-05-29 13:41:59 +08:00
Cheng Zhao
1696237a3f Pass Handle to upper HandleScope when returning a V8 Handle 2015-05-22 21:23:16 +08:00
Cheng Zhao
269be86998 Use Local instead of Handle 2015-05-22 19:11:02 +08:00
deepak1556
39fae3a480 added std::set converter 2015-04-18 01:33:54 +05:30
Cheng Zhao
40da835cbb Don't reset handle before Wrappable is destroyed
It is possible that the user wants to use the V8 object in the destructor.

Fixes atom/atom-shell#1112.
2015-03-23 16:20:59 +08:00
Cheng Zhao
38aba07290 usigned long is uint64 on Linux 2015-03-14 18:47:36 +00:00
Cheng Zhao
a636fad51e Add converter for unsigned long 2015-03-10 16:46:54 -07:00
Cheng Zhao
d0db7bfb58 Add AfterInit method for Wrappable 2015-02-13 11:37:55 +08:00
Cheng Zhao
8d537ee2b6 Remove unneeded helper 2015-02-12 12:55:50 +08:00
Cheng Zhao
3387f33a8e Check internal field before converting 2015-02-11 22:09:42 +08:00
Cheng Zhao
1116a36c15 Avoid unnecessary copy in ConvertToV8 2015-01-14 18:55:38 -08:00
Cheng Zhao
bcf87fd3c9 OVERRIDE => override 2015-01-09 17:23:18 -08:00
Cheng Zhao
753d5675dd Fix ignored exception thrown from constructor. 2015-01-04 22:13:19 -08:00
Cheng Zhao
be2934d9b5 Fix throwing error in constructor 2015-01-02 18:05:25 -08:00
Cheng Zhao
4a1d11b2be Guard against non-constructor call in Constructor::New 2014-10-30 21:54:29 +08:00
Cheng Zhao
b1f7cfa9da Don't throw error in Constructor 2014-10-30 21:31:53 +08:00
Cheng Zhao
cc9d222923 Use NODE_VERSION_AT_LEAST to determine node version 2014-09-30 22:44:27 +08:00
Cheng Zhao
c5b39126ee Make throwing exception when parsing args easier 2014-09-23 23:28:52 +08:00
Cheng Zhao
12f4e9b7ea Add PersistentDictionary. 2014-09-09 14:12:59 +08:00
Cheng Zhao
742923c73d Remove unused constructor of Dictionary. 2014-09-09 13:32:41 +08:00
Cheng Zhao
980036b78a Make ScopedPersistent's interface consistent with V8. 2014-08-10 21:18:42 +08:00
Cheng Zhao
1387d3969e Add callback converter. 2014-08-10 19:05:25 +08:00
Cheng Zhao
5d6921ff2a Use pump to generate source files. 2014-08-10 16:59:50 +08:00
Cheng Zhao
cbb5004ff9 Fix compilation error of Constructor and ScopedPersistent in node 0.10. 2014-08-10 12:17:47 +08:00
Cheng Zhao
9145a08395 Fix compilation error with node 0.10. 2014-08-10 11:20:41 +08:00
Cheng Zhao
3d713baa4c Enable converting ScopedPersistent. 2014-07-21 13:07:56 +08:00
Cheng Zhao
14c851e9f8 Reset handle in weak callback.
This doesn't seem to be neccesary, but we had better follow what upstream does.
2014-07-18 09:37:07 +08:00
Cheng Zhao
e6db1875d0 Some more APIs fixes. 2014-06-28 22:32:35 +08:00
Cheng Zhao
8e056672bc Bring back ScopedPersistent.SetWeak. 2014-06-28 21:26:34 +08:00
Cheng Zhao
6f574c3802 Add APIs to match new V8 APIs. 2014-06-28 19:48:49 +08:00
Cheng Zhao
bfd5f5d221 Strictly check for boolean type. 2014-06-23 21:47:39 +08:00
Cheng Zhao
94044b2950 Mark Dictionary.Get as const. 2014-06-23 21:39:03 +08:00
Cheng Zhao
51a55810b9 Enable creating empty Dictionary directly. 2014-06-23 21:38:46 +08:00
Cheng Zhao
1884b9a235 Add converter for const char*. 2014-06-23 21:24:18 +08:00
Cheng Zhao
730acd59c7 Add object() accessor for Dictionary. 2014-06-23 21:11:00 +08:00
Cheng Zhao
c79aecf64d Call object._init if we have one. 2014-05-27 08:47:06 +08:00
Cheng Zhao
f033e23ea3 No need to reset wrapper_ when we would run destructor. 2014-04-23 12:29:22 +08:00
Cheng Zhao
3d219b4be6 Do not wrap an object when it's already wrapped. 2014-04-22 15:57:23 +08:00
Cheng Zhao
d950fe3736 Add Arguments.Length method. 2014-04-22 15:57:11 +08:00
Cheng Zhao
9cc90ac7d5 Make ScopedPersistent do type conversion. 2014-04-18 16:45:44 +08:00
Cheng Zhao
94dec0ff85 Add v8::Handle<v8::String> to converter. 2014-04-16 15:28:43 +08:00
Cheng Zhao
c9fa29ef64 Enable setting method in Dictionary. 2014-04-16 15:13:44 +08:00
Cheng Zhao
213ac43721 Enable converting void*. 2014-04-16 14:56:33 +08:00
Cheng Zhao
d0bf1a842f Support function with 7 parameters. 2014-04-16 14:56:05 +08:00
Cheng Zhao
2d3af6fc38 Remove helper typedefs. 2014-04-16 14:29:45 +08:00
Cheng Zhao
ace550d6b2 Simplify Wrappable API. 2014-04-16 11:58:17 +08:00
Cheng Zhao
ac5be7dad7 Constructor should wrap the this pointer. 2014-04-16 10:36:54 +08:00
Cheng Zhao
bdfbef41c6 Cleanup. 2014-04-16 10:25:22 +08:00
Cheng Zhao
e2e1faa225 Make the Constructor accept arbitrary callback. 2014-04-16 09:50:51 +08:00
Cheng Zhao
78ab726ec7 Fix passing the wrong parameter. 2014-04-15 15:39:13 +08:00
Cheng Zhao
caa5ea0316 Add initial Constructor type. 2014-04-15 15:30:46 +08:00