We have successfully embedded V8 (4.5.103.35) in our C++ application and
are using JavaScript to implement specific business rules in our
application. Some of the objects exposed to the JavaScript code are
constructed from v8::ObjectTemplate wrappers that access native C++ data
and methods. Other objects are just created from JavaScript itself or from
v8::Object::New.
We have found that the v8::ObjectTemplate based objects are only partially
visible when debugging while the JavaScript and v8::Object::New objects are
fully exposed to the debugger. The v8::ObjectTemplate based objects have
fully implemented NamedPropertyHandlerConfiguration interceptors including
enumeration and query callbacks that work correctly in all other regards.
The behavior that we observe in the debugger is that only the first level
of properties is displayed and that all the associated values are displayed
as "undefined".
Is anyone familiar with this problem? We would like to make our C++
wrapped objects fully exposed to the debugger.
I believe the problem lies in the way that the V8 debugger responses to a
"evaluate" command for the watched global variable "wrapped". The JS
Script looks like this:
var done = false;
while (!done)
{
wrapped.testIntegerValue = 123;
wrapped.testStringValue = "Hello world";
wrapped.testRealValue = 123.456;
wrapped.testDateValue = new Date();
}
With a break-point set at the end of the loop, I can see the proper
assigned values when "wrapped" is created from v8::Object::New() but *NOT*
when "wrapped" is created from v8::ObjectTemplate::NewInstance().
REQUEST:
{"command":"evaluate","arguments":{"expression":"wrapped","disable_break":true,"maxStringLength":10000,"frame":0},"type":"request","seq":24}
=========== Response that works (v8::Object::New) ===========
RESPONSE:
{"seq":27,"request_seq":24,"type":"response","command":"evaluate","success":true,"body":{"handle":38,"type":"object","className":"Object","constructorFunction":{"ref":43},"protoObject":{"ref":4},"prototypeObject":{"ref":2},"properties":[{"name":"testIntegerValue","propertyType":0,"ref":68},{"name":"testStringValue","propertyType":0,"ref":69},{"name":"testRealValue","propertyType":0,"ref":70},{"name":"testDateValue","propertyType":0,"ref":71}],"text":"#<Object>"},"refs":[{"handle":43,"type":"function","className":"Function","constructorFunction":{"ref":39},"protoObject":{"ref":61},"prototypeObject":{"ref":4},"name":"Object","inferredName":"","resolved":true,"source":"function
Object() { [native code]
}","script":{"ref":73},"scriptId":5,"position":20824,"line":943,"column":26,"scopes":[],"properties":[{"name":"length","attributes":3,"propertyType":3,"ref":74},{"name":"name","attributes":3,"propertyType":3,"ref":75},{"name":"arguments","attributes":7,"propertyType":3,"ref":5},{"name":"caller","attributes":7,"propertyType":3,"ref":5},{"name":"prototype","attributes":7,"propertyType":3,"ref":4},{"name":"keys","attributes":2,"propertyType":2,"ref":76},{"name":"create","attributes":2,"propertyType":2,"ref":77},{"name":"defineProperty","attributes":2,"propertyType":2,"ref":78},{"name":"defineProperties","attributes":2,"propertyType":2,"ref":79},{"name":"freeze","attributes":2,"propertyType":2,"ref":80},{"name":"getPrototypeOf","attributes":2,"propertyType":2,"ref":81},{"name":"setPrototypeOf","attributes":2,"propertyType":2,"ref":82},{"name":"getOwnPropertyDescriptor","attributes":2,"propertyType":2,"ref":83},{"name":"getOwnPropertyNames","attributes":2,"propertyType":2,"ref":84},{"name":"is","attributes":2,"propertyType":2,"ref":85},{"name":"isExtensible","attributes":2,"propertyType":2,"ref":86},{"name":"isFrozen","attributes":2,"propertyType":2,"ref":87},{"name":"isSealed","attributes":2,"propertyType":2,"ref":88},{"name":"preventExtensions","attributes":2,"propertyType":2,"ref":89},{"name":"seal","attributes":2,"propertyType":2,"ref":90},{"name":"getOwnPropertySymbols","attributes":2,"propertyType":2,"ref":91},{"name":"deliverChangeRecords","attributes":2,"propertyType":2,"ref":92},{"name":"getNotifier","attributes":2,"propertyType":2,"ref":93},{"name":"observe","attributes":2,"propertyType":2,"ref":94},{"name":"unobserve","attributes":2,"propertyType":2,"ref":95},{"name":"assign","attributes":2,"propertyType":2,"ref":96}],"text":"function
Object() { [native code]
}"},{"handle":4,"type":"object","className":"Object","constructorFunction":{"ref":43},"protoObject":{"ref":5},"prototypeObject":{"ref":2},"properties":[{"name":"constructor","attributes":2,"propertyType":2,"ref":43},{"name":"toString","attributes":2,"propertyType":2,"ref":97},{"name":"toLocaleString","attributes":2,"propertyType":2,"ref":98},{"name":"valueOf","attributes":2,"propertyType":2,"ref":99},{"name":"hasOwnProperty","attributes":2,"propertyType":2,"ref":100},{"name":"isPrototypeOf","attributes":2,"propertyType":2,"ref":101},{"name":"propertyIsEnumerable","attributes":2,"propertyType":2,"ref":102},{"name":"__defineGetter__","attributes":2,"propertyType":2,"ref":103},{"name":"__lookupGetter__","attributes":2,"propertyType":2,"ref":104},{"name":"__defineSetter__","attributes":2,"propertyType":2,"ref":105},{"name":"__lookupSetter__","attributes":2,"propertyType":2,"ref":106},{"name":"__proto__","attributes":2,"propertyType":3,"ref":2}],"text":"#<Object>"},{"handle":2,"type":"undefined","text":"undefined"},{"handle":68,"type":"number","value":123,"text":"123"},{"handle":69,"type":"string","value":"Hello
world","length":11,"text":"Hello
world"},{"handle":70,"type":"number","value":123.456,"text":"123.456"},{"handle":71,"type":"object","className":"Date","constructorFunction":{"ref":47},"protoObject":{"ref":107},"prototypeObject":{"ref":2},"value":"2015-12-21T19:45:54.964Z","properties":[],"text":"2015-12-21T19:45:54.964Z"}],"running":false}
=========== Response that does not work (v8::ObjectTemplate::NewInstance)
===========
RESPONSE:
{"seq":27,"request_seq":24,"type":"response","command":"evaluate","success":true,"body":{"handle":31,"type":"object","className":"Object","constructorFunction":{"ref":2},"protoObject":{"ref":68},"prototypeObject":{"ref":2},"namedInterceptor":true,"properties":[{"name":"clear","propertyType":0,"ref":2},{"name":"cleanup","propertyType":0,"ref":2},{"name":"testIntegerValue","propertyType":0,"ref":2},{"name":"testStringValue","propertyType":0,"ref":2},{"name":"testRealValue","propertyType":0,"ref":2},{"name":"testDateValue","propertyType":0,"ref":2},{"name":"testIntegerValue","propertyType":0,"ref":2},{"name":"testStringValue","propertyType":0,"ref":2},{"name":"testRealValue","propertyType":0,"ref":2},{"name":"testDateValue","propertyType":0,"ref":2}],"text":"#<Object>"},"refs":[{"handle":2,"type":"undefined","text":"undefined"},{"handle":68,"type":"object","className":"Object","constructorFunction":{"ref":69},"protoObject":{"ref":4},"prototypeObject":{"ref":2},"properties":[{"name":"constructor","attributes":2,"propertyType":2,"ref":69}],"text":"#<Object>"}],"running":false}
--
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users" 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.