On Mon, Aug 22, 2016 at 2:33 PM, Fanda Mazura <[email protected]>
wrote:

> Thank you for response. I need dynamic analyze any JavaScript. If I put JS
> file, I need log (all function and object) what is created, called, changed
> etc. And this I need without change JS file. It can be slow. Is any central
> point where all function, object if is in JS code called, changed are call
> (C++ class/method)?
>

As I said before: no, you would have to modify many different code paths
(several components in each of C++ runtime code, code stubs, and all the
compilers). It will be months of work.


>
> Thank.
>
> Dne pondělí 22. srpna 2016 13:25:28 UTC+2 Jakob Kummerow napsal(a):
>
>> This is going to be very, very hard. Your examples are different things
>> (global variable declaration is not the same as object property addition),
>> and there are many different code paths you'd have to modify.
>>
>> I'd suggest to take a step back and consider other approaches to whatever
>> it is you're trying to accomplish. For example, if you're embedding V8,
>> maybe an interceptor on the global object would help. If you want to
>> monitor accesses to individual objects, you can wrap them in a Proxy (which
>> is super slow; but then again logging all sorts of stuff is going to be
>> super slow anyways). If you even know which properties you're interested
>> in, using setters would be reasonable. If you want to analyze what a
>> particular program is doing, you can use DevTools to step through it line
>> by line and/or set breakpoints in interesting locations.
>>
>> Also, to be pedantic:
>>
>> var test = "123"; // console > "Object has been created, value is 123"
>>>
>>
>> No object has been created here. "123" is just a number, not an object.
>>
>>
>>> test.foo = "foo" // console > "Object has been edited value is
>>> {foo:"foo"} "
>>>
>>
>> Not quite, as you can't set properties on numbers:
>> -> var test = 123
>> -> test.foo = "foo"
>> -> test
>> 123
>> -> test.foo
>> undefined
>>
>> --
> --
> v8-dev mailing list
> [email protected]
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to