Problem with box2d and cocos2d-html

I am creating a box2d body with following code.
//code
var bodyDef = new b2BodyDef();
bodyDef.type = b2Body.b2_dynamicBody;
bodyDef.position.Set((p.x) / PTM_RATIO,(p.y) / PTM_RATIO);
bodyDef.userData = sprite;
var body = this.world.CreateBody(bodyDef);

// Define another box shape for our dynamic body.
var dynamicBox = new b2PolygonShape();
dynamicBox.SetAsBox(0.5, 0.5);//These are mid points for our 1m box

var fixtureDef = new b2FixtureDef();
fixtureDef.shape = dynamicBox;
fixtureDef.density = 1.0;
fixtureDef.friction = 1.0;
fixtureDef.restitution = 0.2;
body.CreateFixture(fixtureDef);

After that when i apply impulse on the body
body.ApplyImpulse(b2Vec2(20,20));

I get the following errors.
is this a cocos2d-js issue ??

I think here is the problem: (you do not create the object)

body.ApplyImpulse(b2Vec2(20,20));

try:

body.ApplyImpulse(new b2Vec2(20,20));

This should solve an issue.

hey thanks, that was it. I figured it out soon after posting,but forgot to update the post though.