1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
Commit graph

42 commits

Author SHA1 Message Date
Anton Sidelnikov
1aed74575c Conversion trick for 64-bit Fixnums, with fixed tests 2012-08-01 21:16:48 +07:00
Charles Lowell
531d5685bb Revert "Conversion trick for 64-bit Fixnums"
see 2002117

This reverts commit fde0d8ae9a.
2012-07-31 19:56:04 +03:00
Anton Sidelnikov
fde0d8ae9a Conversion trick for 64-bit Fixnums 2012-07-26 13:10:03 +07:00
Charles Lowell
22682755a3 formatting nit. 2012-07-24 23:29:23 +03:00
Charles Lowell
c5b13ea115 Move Get,Set,Constructor and friends out of Class
Even though they had been moved into the
`ClassAction` module, that module still had the
potential for conflict. Instead, we'll just put 
evenything in the Conversion namespace. That way
we need not worry.
2012-07-24 23:25:56 +03:00
Rodrigo Kochenburger
7f3a8cb91f Fix loading of V8::Conversion classes inside an eigenclass 2012-07-23 21:06:45 -03:00
Charles Lowell
77804fce1c Don't check for strings and primitives in idmap.
It appears that `Ref::WeakValueMap` is not 100%
correct. There are cases where entries are 
temporarily corrupted; probably while attached
finalizers run.

This is a slight decrease in flexibility in that
strings and primitives cannot maintain referential
integrity when passed by reference to v8, but the
default is to pass them by value anyway, and it
greatly reduces the number of object_ids that the
idmap sees and therefore reduces the chances of 
a recycled object id causing a bad lookup.

While this is not a perfect fix, it does make a
collision very unlikely, and it prevents the 
crashes being seen in #169 

If this pops up again,
we'll have to look at getting a perfectly reliable
weakmap implementation.
2012-06-20 15:30:34 -05:00
Charles Lowell
da11a11987 hold a reference to the Ruby object
When we have a JS object that proxies a Ruby
object, store a hard reference to the Ruby object
so that it cannot be garbage collected as long as
a reference is being held from within JavaScript.
2012-06-20 13:06:02 -05:00
Charles Lowell
1a93c34b07 remove WeakRef from the equation
It turns out that the Ruby stdlib WeakRef class is
completely broken. 

http://bugs.ruby-lang.org/issues/4168

While it is fixed in trunk, it is not useable, so
as a temporary measure, use the `ref` gem as a 
dependency. It appears to be both faster and more
correct.
2012-06-20 04:35:40 -05:00
Charles Lowell
87efe139e9 avoid potential race condition.
in between the weakref_alive? check and the actual
dereference via `__getobj__` the weak reference
could have been collected. It's better to just go
ahead and do the deref. If it throws an error,
then we know it didn't work.
2012-06-19 08:33:48 -05:00
Charles Lowell
1ce63c508c extract default object conversion 2012-06-19 04:42:04 -05:00
Charles Lowell
2978306272 proper fix for bigdecimal and bignum conversion. 2012-06-17 02:42:23 -05:00
Charles Lowell
d1249cb59a eval_js() removed from redjs 2012-06-16 12:31:48 -05:00
Charles Lowell
1349384c08 allow embedding BigDecimal 2012-06-16 12:31:08 -05:00
Charles Lowell
0f691539e8 delegate invocation to callables via the context 2012-06-16 07:39:11 -05:00
Charles Lowell
f65e3261a5 extract proc conversion into generic 'code' conversion 2012-06-16 04:56:49 -05:00
Charles Lowell
b0fabb2f28 proc invocation handlers reference procs directly 2012-06-16 03:44:58 -05:00
Charles Lowell
5de969fd97 meh. provide eval_js... not so crazy about it. 2012-06-15 10:10:22 -05:00
Charles Lowell
a9079e02ad connect constructors via inheritance hierarchy. 2012-06-15 10:06:22 -05:00
Charles Lowell
478d99b72f move object access to the class layer. 2012-06-15 09:57:42 -05:00
Charles Lowell
e7db9d8d38 Use class constructor to generate object proxies 2012-06-15 08:26:47 -05:00
Charles Lowell
d020ba13b3 construct Ruby objects from JavaScript 2012-06-15 08:02:17 -05:00
Charles Lowell
6a306a93db construct valid instances 2012-06-15 05:43:12 -05:00
Charles Lowell
822b1eb759 factor out common property interceptor code. 2012-06-15 05:33:18 -05:00
Charles Lowell
bde7661189 referential integrity between class constructors 2012-06-15 05:12:52 -05:00
Charles Lowell
7bc06b27c0 embed classes as constructors 2012-06-14 23:11:21 -05:00
Charles Lowell
be963bbc95 implement exception handling. 2012-06-14 22:34:38 -05:00
Charles Lowell
bcb58e805a remove errant puts 2012-06-14 11:46:45 -05:00
Charles Lowell
2fac2cdb5f always return the same proc for a given function 2012-06-12 07:27:28 -05:00
Charles Lowell
bbef262f17 call JavaScript functions from Ruby. 2012-06-12 07:06:25 -05:00
Charles Lowell
fb4ac37c69 support indexed getters on object. 2012-06-12 04:18:17 -05:00
Charles Lowell
476367a133 use weakcell to manage template reference. 2012-06-12 03:51:07 -05:00
Charles Lowell
d8579acf28 create a context with a Ruby object as its scope 2012-06-12 03:44:50 -05:00
Charles Lowell
ad7e9dddb7 set named Ruby properties from JS 2012-06-11 16:21:06 -05:00
Charles Lowell
4a8612f5c4 truncate/fill arguments according to Ruby arity 2012-06-11 16:20:42 -05:00
Charles Lowell
1c9694a732 extract Ruby object access. 2012-06-11 11:50:41 -05:00
Charles Lowell
2404e0c0f8 embed classes into javascript 2012-06-11 07:34:02 -05:00
Charles Lowell
683e525902 embed objects, call their methods. 2012-06-11 07:14:00 -05:00
Charles Lowell
65acfdbe6a maintain referential integrity for embedded procs 2012-06-11 05:14:15 -05:00
Charles Lowell
6157d35d4a support two-way identity mapping 2012-06-11 05:07:13 -05:00
Charles Lowell
6dbd647680 Pass empty handles from Ruby. 2012-06-11 05:05:45 -05:00
Charles Lowell
32028f31fc factor out v8 conversions into separate modules 2012-06-11 01:58:12 -05:00