try {
try {
// Convert the JSON string to an object.
- request = %CompileString('(' + json_request + ')')();
+ request = JSON.parse(json_request);
// Create an initial response.
response = this.createResponse(request);
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
v8::Persistent<v8::Context> context_1;
v8::Handle<v8::ObjectTemplate> global_template =
v8::Handle<v8::ObjectTemplate>();
- v8::Handle<v8::Value> global_object = v8::Handle<v8::Value>();
- context_1 = v8::Context::New(NULL, global_template, global_object);
+ context_1 = v8::Context::New(NULL, global_template);
// Default data value is undefined.
CHECK(context_1->GetData()->IsUndefined());
const int kBufferSize = 1000;
uint16_t buffer[kBufferSize];
const char* eval_command =
- "{\"seq\":0,"
- "\"type\":\"request\","
- "\"command\":\"evaluate\","
- "arguments:{\"expression\":\"debugger;\","
- "\"global\":true,\"disable_break\":false}}";
+ "{\"seq\":0,"
+ "\"type\":\"request\","
+ "\"command\":\"evaluate\","
+ "\"arguments\":{\"expression\":\"debugger;\","
+ "\"global\":true,\"disable_break\":false}}";
// Send evaluate command.
v8::Debug::SendCommand(buffer, AsciiToUtf16(eval_command, buffer));
// parameter is passed.
testRequest(
dcp,
- '{"expression":"this.longString","global":true,maxStringLength:-1}',
+ '{"expression":"this.longString","global":true,"maxStringLength":-1}',
true,
longString);
testRequest(
dcp,
- '{"expression":"this.longString","global":true,maxStringLength:' +
+ '{"expression":"this.longString","global":true,"maxStringLength":' +
longString.length + '}',
true,
longString);
var truncatedStringSuffix = '... (length: ' + longString.length + ')';
testRequest(
dcp,
- '{"expression":"this.longString","global":true,maxStringLength:0}',
+ '{"expression":"this.longString","global":true,"maxStringLength":0}',
true,
truncatedStringSuffix);
testRequest(
dcp,
- '{"expression":"this.longString","global":true,maxStringLength:1}',
+ '{"expression":"this.longString","global":true,"maxStringLength":1}',
true,
longString.charAt(0) + truncatedStringSuffix);
// Test that by default string is truncated to first 80 chars.
testArguments(dcp, '{"types":2}', true);
testArguments(dcp, '{"types":4}', true);
testArguments(dcp, '{"types":7}', true);
- testArguments(dcp, '{"types":0xFF}', true);
+ testArguments(dcp, '{"types":255}', true);
// Test request for all scripts.
var request = '{' + base_request + '}'