-// Copyright 2008 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+// Copyright 2008 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This is a test of making an API call after an exception thrown in JavaScript
// has been bypassed by a return in the finally block.
-// Copyright 2008 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Flags: --expose-debug-as debug\r
-// Get the Debug object exposed from the debug context global object.\r
-var Debug = debug.Debug\r
-\r
-// Simple function which stores the last debug event.\r
-var listenerComplete = false;\r
-var exception = false;\r
-\r
-var base_request = '"seq":0,"type":"request","command":"clearbreakpointgroup"';\r
-var scriptId = null;\r
-\r
-function safeEval(code) {\r
- try {\r
- return eval('(' + code + ')');\r
- } catch (e) {\r
- assertEquals(void 0, e);\r
- return undefined;\r
- }\r
-}\r
-\r
-function testArguments(dcp, arguments, success) {\r
- var request = '{' + base_request + ',"arguments":' + arguments + '}'\r
- var json_response = dcp.processDebugJSONRequest(request);\r
- var response = safeEval(json_response);\r
- if (success) {\r
- assertTrue(response.success, json_response);\r
- } else {\r
- assertFalse(response.success, json_response);\r
- }\r
-}\r
-\r
-function listener(event, exec_state, event_data, data) {\r
- try {\r
- if (event == Debug.DebugEvent.Break) {\r
- // Get the debug command processor.\r
- var dcp = exec_state.debugCommandProcessor("unspecified_running_state");\r
-\r
- // Clear breakpoint group 1.\r
- testArguments(dcp, '{"groupId":1}', true);\r
-\r
- // Indicate that all was processed.\r
- listenerComplete = true;\r
- } else if (event == Debug.DebugEvent.AfterCompile) {\r
- scriptId = event_data.script().id();\r
- assertEquals(source, event_data.script().source());\r
- }\r
- } catch (e) {\r
- exception = e\r
- };\r
-};\r
-\r
-\r
-// Add the debug event listener.\r
-Debug.setListener(listener);\r
-\r
-var source = 'function f(n) {\nreturn n+1;\n}\nfunction g() {return f(10);}' +\r
- '\nvar r = g(); g;';\r
-eval(source);\r
-\r
-assertNotNull(scriptId);\r
-\r
-var groupId1 = 1;\r
-var groupId2 = 2;\r
-// Set a break point and call to invoke the debug event listener.\r
-var bp1 = Debug.setScriptBreakPointById(scriptId, 1, null, null, groupId1);\r
-var bp2 = Debug.setScriptBreakPointById(scriptId, 1, null, null, groupId2);\r
-var bp3 = Debug.setScriptBreakPointById(scriptId, 1, null, null, null);\r
-var bp4 = Debug.setScriptBreakPointById(scriptId, 3, null, null, groupId1);\r
-var bp5 = Debug.setScriptBreakPointById(scriptId, 4, null, null, groupId2);\r
-\r
-assertEquals(5, Debug.scriptBreakPoints().length);\r
-\r
-// Call function 'g' from the compiled script to trigger breakpoint.\r
-g();\r
-\r
-// Make sure that the debug event listener vas invoked.\r
-assertTrue(listenerComplete,\r
- "listener did not run to completion: " + exception);\r
-\r
-var breakpoints = Debug.scriptBreakPoints();\r
-assertEquals(3, breakpoints.length);\r
-var breakpointNumbers = breakpoints.map(\r
- function(scriptBreakpoint) { return scriptBreakpoint.number(); },\r
- breakpointNumbers);\r
-\r
-// Check that all breakpoints from group 1 were deleted and all the\r
-// rest are preserved.\r
-assertEquals([bp2, bp3, bp5].sort(), breakpointNumbers.sort());\r
-\r
-assertFalse(exception, "exception in listener");\r
+// Copyright 2008 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+// Get the Debug object exposed from the debug context global object.
+var Debug = debug.Debug
+
+// Simple function which stores the last debug event.
+var listenerComplete = false;
+var exception = false;
+
+var base_request = '"seq":0,"type":"request","command":"clearbreakpointgroup"';
+var scriptId = null;
+
+function safeEval(code) {
+ try {
+ return eval('(' + code + ')');
+ } catch (e) {
+ assertEquals(void 0, e);
+ return undefined;
+ }
+}
+
+function testArguments(dcp, arguments, success) {
+ var request = '{' + base_request + ',"arguments":' + arguments + '}'
+ var json_response = dcp.processDebugJSONRequest(request);
+ var response = safeEval(json_response);
+ if (success) {
+ assertTrue(response.success, json_response);
+ } else {
+ assertFalse(response.success, json_response);
+ }
+}
+
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ // Get the debug command processor.
+ var dcp = exec_state.debugCommandProcessor("unspecified_running_state");
+
+ // Clear breakpoint group 1.
+ testArguments(dcp, '{"groupId":1}', true);
+
+ // Indicate that all was processed.
+ listenerComplete = true;
+ } else if (event == Debug.DebugEvent.AfterCompile) {
+ scriptId = event_data.script().id();
+ assertEquals(source, event_data.script().source());
+ }
+ } catch (e) {
+ exception = e
+ };
+};
+
+
+// Add the debug event listener.
+Debug.setListener(listener);
+
+var source = 'function f(n) {\nreturn n+1;\n}\nfunction g() {return f(10);}' +
+ '\nvar r = g(); g;';
+eval(source);
+
+assertNotNull(scriptId);
+
+var groupId1 = 1;
+var groupId2 = 2;
+// Set a break point and call to invoke the debug event listener.
+var bp1 = Debug.setScriptBreakPointById(scriptId, 1, null, null, groupId1);
+var bp2 = Debug.setScriptBreakPointById(scriptId, 1, null, null, groupId2);
+var bp3 = Debug.setScriptBreakPointById(scriptId, 1, null, null, null);
+var bp4 = Debug.setScriptBreakPointById(scriptId, 3, null, null, groupId1);
+var bp5 = Debug.setScriptBreakPointById(scriptId, 4, null, null, groupId2);
+
+assertEquals(5, Debug.scriptBreakPoints().length);
+
+// Call function 'g' from the compiled script to trigger breakpoint.
+g();
+
+// Make sure that the debug event listener vas invoked.
+assertTrue(listenerComplete,
+ "listener did not run to completion: " + exception);
+
+var breakpoints = Debug.scriptBreakPoints();
+assertEquals(3, breakpoints.length);
+var breakpointNumbers = breakpoints.map(
+ function(scriptBreakpoint) { return scriptBreakpoint.number(); },
+ breakpointNumbers);
+
+// Check that all breakpoints from group 1 were deleted and all the
+// rest are preserved.
+assertEquals([bp2, bp3, bp5].sort(), breakpointNumbers.sort());
+
+assertFalse(exception, "exception in listener");
-// Copyright 2009 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Flags: --expose-debug-as debug\r
-// Get the Debug object exposed from the debug context global object.\r
-Debug = debug.Debug\r
-\r
-var listenerComplete = false;\r
-var exception = false;\r
-\r
-function listener(event, exec_state, event_data, data) {\r
- try {\r
- if (event == Debug.DebugEvent.Break) {\r
- // Get the debug command processor.\r
- var dcp = exec_state.debugCommandProcessor();\r
-\r
- var request = {\r
- seq: 0,\r
- type: 'request',\r
- command: 'evaluate',\r
- arguments: {\r
- expression: 'a',\r
- frame: 0\r
- }\r
- };\r
- request = JSON.stringify(request);\r
-\r
- var resp = dcp.processDebugJSONRequest(request);\r
- var response = JSON.parse(resp);\r
- assertTrue(response.success, 'Command failed: ' + resp);\r
- assertEquals('object', response.body.type);\r
- assertEquals('Object', response.body.className);\r
-\r
- // Indicate that all was processed.\r
- listenerComplete = true;\r
- }\r
- } catch (e) {\r
- exception = e\r
- };\r
-};\r
-\r
-// Add the debug event listener.\r
-Debug.setListener(listener);\r
-\r
-function callDebugger() {\r
- // Add set constructor field to a non-function value.\r
- var a = {constructor:true};\r
- debugger;\r
-}\r
-\r
-callDebugger();\r
-\r
-\r
-// Make sure that the debug event listener vas invoked.\r
-assertFalse(exception, "exception in listener")\r
-assertTrue(listenerComplete, "listener did not run to completion");\r
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+var listenerComplete = false;
+var exception = false;
+
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ // Get the debug command processor.
+ var dcp = exec_state.debugCommandProcessor();
+
+ var request = {
+ seq: 0,
+ type: 'request',
+ command: 'evaluate',
+ arguments: {
+ expression: 'a',
+ frame: 0
+ }
+ };
+ request = JSON.stringify(request);
+
+ var resp = dcp.processDebugJSONRequest(request);
+ var response = JSON.parse(resp);
+ assertTrue(response.success, 'Command failed: ' + resp);
+ assertEquals('object', response.body.type);
+ assertEquals('Object', response.body.className);
+
+ // Indicate that all was processed.
+ listenerComplete = true;
+ }
+ } catch (e) {
+ exception = e
+ };
+};
+
+// Add the debug event listener.
+Debug.setListener(listener);
+
+function callDebugger() {
+ // Add set constructor field to a non-function value.
+ var a = {constructor:true};
+ debugger;
+}
+
+callDebugger();
+
+
+// Make sure that the debug event listener vas invoked.
+assertFalse(exception, "exception in listener")
+assertTrue(listenerComplete, "listener did not run to completion");
-// Copyright 2009 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Flags: --expose-debug-as debug\r
-// Get the Debug object exposed from the debug context global object.\r
-Debug = debug.Debug\r
-\r
-listenerComplete = false;\r
-exception = false;\r
-\r
-// The base part of all evaluate requests.\r
-var base_request = '"seq":0,"type":"request","command":"references"'\r
-\r
-function safeEval(code) {\r
- try {\r
- return eval('(' + code + ')');\r
- } catch (e) {\r
- assertEquals(void 0, e);\r
- return undefined;\r
- }\r
-}\r
-\r
-function testRequest(dcp, arguments, success, count) {\r
- // Generate request with the supplied arguments.\r
- var request;\r
- if (arguments) {\r
- request = '{' + base_request + ',"arguments":' + arguments + '}';\r
- } else {\r
- request = '{' + base_request + '}'\r
- }\r
- \r
- // Process the request and check expectation.\r
- var response = safeEval(dcp.processDebugJSONRequest(request));\r
- if (success) {\r
- assertTrue(response.success, request + ' -> ' + response.message);\r
- assertTrue(response.body instanceof Array);\r
- if (count) {\r
- assertEquals(count, response.body.length);\r
- } else {\r
- assertTrue(response.body.length > 0);\r
- }\r
- } else {\r
- assertFalse(response.success, request + ' -> ' + response.message);\r
- }\r
- assertEquals(response.running, dcp.isRunning(), request + ' -> expected not running');\r
-}\r
-\r
-function listener(event, exec_state, event_data, data) {\r
- try {\r
- if (event == Debug.DebugEvent.Break) {\r
- // Get the debug command processor.\r
- var dcp = exec_state.debugCommandProcessor("unspecified_running_state");\r
-\r
- // Test some illegal references requests.\r
- testRequest(dcp, void 0, false);\r
- testRequest(dcp, '{"handle":"a"}', false);\r
- testRequest(dcp, '{"handle":1}', false);\r
- testRequest(dcp, '{"type":"referencedBy"}', false);\r
- testRequest(dcp, '{"type":"constructedBy"}', false);\r
-\r
- // Evaluate Point.\r
- var evaluate_point = '{"seq":0,"type":"request","command":"evaluate",' +\r
- '"arguments":{"expression":"Point"}}';\r
- var response = safeEval(dcp.processDebugJSONRequest(evaluate_point));\r
- assertTrue(response.success, "Evaluation of Point failed");\r
- var handle = response.body.handle;\r
- \r
- // Test some legal references requests.\r
- testRequest(dcp, '{"handle":' + handle + ',"type":"referencedBy"}', true);\r
- testRequest(dcp, '{"handle":' + handle + ',"type":"constructedBy"}',\r
- true, 2);\r
-\r
- // Indicate that all was processed.\r
- listenerComplete = true;\r
- }\r
- } catch (e) {\r
- exception = e\r
- };\r
-};\r
-\r
-// Add the debug event listener.\r
-Debug.setListener(listener);\r
-\r
-// Test constructor and objects.\r
-function Point(x, y) { this.x_ = x; this.y_ = y;}\r
-p = new Point(0,0);\r
-q = new Point(1,2);\r
-\r
-// Enter debugger causing the event listener to be called.\r
-debugger;\r
-\r
-// Make sure that the debug event listener was invoked.\r
-assertFalse(exception, "exception in listener")\r
-assertTrue(listenerComplete, "listener did not run to completion");\r
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+listenerComplete = false;
+exception = false;
+
+// The base part of all evaluate requests.
+var base_request = '"seq":0,"type":"request","command":"references"'
+
+function safeEval(code) {
+ try {
+ return eval('(' + code + ')');
+ } catch (e) {
+ assertEquals(void 0, e);
+ return undefined;
+ }
+}
+
+function testRequest(dcp, arguments, success, count) {
+ // Generate request with the supplied arguments.
+ var request;
+ if (arguments) {
+ request = '{' + base_request + ',"arguments":' + arguments + '}';
+ } else {
+ request = '{' + base_request + '}'
+ }
+
+ // Process the request and check expectation.
+ var response = safeEval(dcp.processDebugJSONRequest(request));
+ if (success) {
+ assertTrue(response.success, request + ' -> ' + response.message);
+ assertTrue(response.body instanceof Array);
+ if (count) {
+ assertEquals(count, response.body.length);
+ } else {
+ assertTrue(response.body.length > 0);
+ }
+ } else {
+ assertFalse(response.success, request + ' -> ' + response.message);
+ }
+ assertEquals(response.running, dcp.isRunning(), request + ' -> expected not running');
+}
+
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ // Get the debug command processor.
+ var dcp = exec_state.debugCommandProcessor("unspecified_running_state");
+
+ // Test some illegal references requests.
+ testRequest(dcp, void 0, false);
+ testRequest(dcp, '{"handle":"a"}', false);
+ testRequest(dcp, '{"handle":1}', false);
+ testRequest(dcp, '{"type":"referencedBy"}', false);
+ testRequest(dcp, '{"type":"constructedBy"}', false);
+
+ // Evaluate Point.
+ var evaluate_point = '{"seq":0,"type":"request","command":"evaluate",' +
+ '"arguments":{"expression":"Point"}}';
+ var response = safeEval(dcp.processDebugJSONRequest(evaluate_point));
+ assertTrue(response.success, "Evaluation of Point failed");
+ var handle = response.body.handle;
+
+ // Test some legal references requests.
+ testRequest(dcp, '{"handle":' + handle + ',"type":"referencedBy"}', true);
+ testRequest(dcp, '{"handle":' + handle + ',"type":"constructedBy"}',
+ true, 2);
+
+ // Indicate that all was processed.
+ listenerComplete = true;
+ }
+ } catch (e) {
+ exception = e
+ };
+};
+
+// Add the debug event listener.
+Debug.setListener(listener);
+
+// Test constructor and objects.
+function Point(x, y) { this.x_ = x; this.y_ = y;}
+p = new Point(0,0);
+q = new Point(1,2);
+
+// Enter debugger causing the event listener to be called.
+debugger;
+
+// Make sure that the debug event listener was invoked.
+assertFalse(exception, "exception in listener")
+assertTrue(listenerComplete, "listener did not run to completion");
-// Copyright 2008 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Flags: --expose-debug-as debug\r
-\r
-// Get the Debug object exposed from the debug context global object.\r
-Debug = debug.Debug\r
-\r
-var exception = null;\r
-var state = 1;\r
-var expected_source_line_text = null;\r
-var expected_function_name = null;\r
-\r
-// Simple debug event handler which first time will cause 'step in' action\r
-// to get into g.call and than check that execution is stopped inside\r
-// function 'g'.\r
-function listener(event, exec_state, event_data, data) {\r
- try {\r
- if (event == Debug.DebugEvent.Break) {\r
- if (state == 1) {\r
- exec_state.prepareStep(Debug.StepAction.StepIn, 2);\r
- state = 2;\r
- } else if (state == 2) {\r
- assertEquals(expected_source_line_text,\r
- event_data.sourceLineText());\r
- assertEquals(expected_function_name, event_data.func().name());\r
- state = 3;\r
- }\r
- }\r
- } catch(e) {\r
- exception = e;\r
- }\r
-};\r
-\r
-// Add the debug event listener.\r
-Debug.setListener(listener);\r
-\r
-\r
-var c = {\r
- name: 'name ',\r
- get getter1() {\r
- return this.name; // getter 1\r
- },\r
- get getter2() {\r
- return { // getter 2\r
- 'a': c.name\r
- };\r
- },\r
- set setter1(n) {\r
- this.name = n; // setter 1\r
- }\r
-};\r
-\r
-c.__defineGetter__('y', function getterY() {\r
- return this.name; // getter y\r
-});\r
-\r
-c.__defineGetter__(3, function getter3() {\r
- return this.name; // getter 3\r
-});\r
-\r
-c.__defineSetter__('y', function setterY(n) {\r
- this.name = n; // setter y\r
-});\r
-\r
-c.__defineSetter__(3, function setter3(n) {\r
- this.name = n; // setter 3\r
-});\r
-\r
-var d = {\r
- 'c': c,\r
-};\r
-\r
-function testGetter1_1() {\r
- expected_function_name = 'getter1';\r
- expected_source_line_text = ' return this.name; // getter 1';\r
- debugger;\r
- var x = c.getter1;\r
-}\r
-\r
-function testGetter1_2() {\r
- expected_function_name = 'getter1';\r
- expected_source_line_text = ' return this.name; // getter 1';\r
- debugger;\r
- var x = c['getter1'];\r
-}\r
-\r
-function testGetter1_3() {\r
- expected_function_name = 'getter1';\r
- expected_source_line_text = ' return this.name; // getter 1';\r
- debugger;\r
- for (var i = 1; i < 2; i++) {\r
- var x = c['getter' + i];\r
- }\r
-}\r
-\r
-function testGetter1_4() {\r
- expected_function_name = 'getter1';\r
- expected_source_line_text = ' return this.name; // getter 1';\r
- debugger;\r
- var x = d.c.getter1;\r
-}\r
-\r
-function testGetter1_5() {\r
- expected_function_name = 'getter1';\r
- expected_source_line_text = ' return this.name; // getter 1';\r
- for (var i = 2; i != 1; i--);\r
- debugger;\r
- var x = d.c['getter' + i];\r
-}\r
-\r
-function testGetter2_1() {\r
- expected_function_name = 'getter2';\r
- expected_source_line_text = ' return { // getter 2';\r
- for (var i = 2; i != 1; i--);\r
- debugger;\r
- var t = d.c.getter2.name;\r
-}\r
-\r
-\r
-function testGetterY_1() {\r
- expected_function_name = 'getterY';\r
- expected_source_line_text = ' return this.name; // getter y';\r
- debugger;\r
- var t = d.c.y;\r
-}\r
-\r
-function testIndexedGetter3_1() {\r
- expected_function_name = 'getter3';\r
- expected_source_line_text = ' return this.name; // getter 3';\r
- debugger;\r
- var r = d.c[3];\r
-}\r
-\r
-function testSetterY_1() {\r
- expected_function_name = 'setterY';\r
- expected_source_line_text = ' this.name = n; // setter y';\r
- debugger;\r
- d.c.y = 'www';\r
-}\r
-\r
-function testIndexedSetter3_1() {\r
- expected_function_name = 'setter3';\r
- expected_source_line_text = ' this.name = n; // setter 3';\r
- var i = 3\r
- debugger;\r
- d.c[3] = 'www';\r
-}\r
-\r
-function testSetter1_1() {\r
- expected_function_name = 'setter1';\r
- expected_source_line_text = ' this.name = n; // setter 1';\r
- debugger;\r
- d.c.setter1 = 'aa';\r
-}\r
-\r
-function testSetter1_2() {\r
- expected_function_name = 'setter1';\r
- expected_source_line_text = ' this.name = n; // setter 1';\r
- debugger;\r
- d.c['setter1'] = 'bb';\r
-}\r
-\r
-function testSetter1_3() {\r
- expected_function_name = 'setter1';\r
- expected_source_line_text = ' this.name = n; // setter 1';\r
- for (var i = 2; i != 1; i--);\r
- debugger;\r
- d.c['setter' + i] = i;\r
-}\r
-\r
-var e = {\r
- name: 'e'\r
-};\r
-e.__proto__ = c;\r
-\r
-function testProtoGetter1_1() {\r
- expected_function_name = 'getter1';\r
- expected_source_line_text = ' return this.name; // getter 1';\r
- debugger;\r
- var x = e.getter1;\r
-}\r
-\r
-function testProtoSetter1_1() {\r
- expected_function_name = 'setter1';\r
- expected_source_line_text = ' this.name = n; // setter 1';\r
- debugger;\r
- e.setter1 = 'aa';\r
-}\r
-\r
-function testProtoIndexedGetter3_1() {\r
- expected_function_name = 'getter3';\r
- expected_source_line_text = ' return this.name; // getter 3';\r
- debugger;\r
- var x = e[3];\r
-}\r
-\r
-function testProtoIndexedSetter3_1() {\r
- expected_function_name = 'setter3';\r
- expected_source_line_text = ' this.name = n; // setter 3';\r
- debugger;\r
- e[3] = 'new val';\r
-}\r
-\r
-function testProtoSetter1_2() {\r
- expected_function_name = 'setter1';\r
- expected_source_line_text = ' this.name = n; // setter 1';\r
- for (var i = 2; i != 1; i--);\r
- debugger;\r
- e['setter' + i] = 'aa';\r
-}\r
-\r
-for (var n in this) {\r
- if (n.substr(0, 4) != 'test') {\r
- continue;\r
- }\r
- state = 1;\r
- this[n]();\r
- assertNull(exception);\r
- assertEquals(3, state);\r
-}\r
-\r
-// Get rid of the debug event listener.\r
-Debug.setListener(null);\r
+// Copyright 2008 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+var exception = null;
+var state = 1;
+var expected_source_line_text = null;
+var expected_function_name = null;
+
+// Simple debug event handler which first time will cause 'step in' action
+// to get into g.call and than check that execution is stopped inside
+// function 'g'.
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ if (state == 1) {
+ exec_state.prepareStep(Debug.StepAction.StepIn, 2);
+ state = 2;
+ } else if (state == 2) {
+ assertEquals(expected_source_line_text,
+ event_data.sourceLineText());
+ assertEquals(expected_function_name, event_data.func().name());
+ state = 3;
+ }
+ }
+ } catch(e) {
+ exception = e;
+ }
+};
+
+// Add the debug event listener.
+Debug.setListener(listener);
+
+
+var c = {
+ name: 'name ',
+ get getter1() {
+ return this.name; // getter 1
+ },
+ get getter2() {
+ return { // getter 2
+ 'a': c.name
+ };
+ },
+ set setter1(n) {
+ this.name = n; // setter 1
+ }
+};
+
+c.__defineGetter__('y', function getterY() {
+ return this.name; // getter y
+});
+
+c.__defineGetter__(3, function getter3() {
+ return this.name; // getter 3
+});
+
+c.__defineSetter__('y', function setterY(n) {
+ this.name = n; // setter y
+});
+
+c.__defineSetter__(3, function setter3(n) {
+ this.name = n; // setter 3
+});
+
+var d = {
+ 'c': c,
+};
+
+function testGetter1_1() {
+ expected_function_name = 'getter1';
+ expected_source_line_text = ' return this.name; // getter 1';
+ debugger;
+ var x = c.getter1;
+}
+
+function testGetter1_2() {
+ expected_function_name = 'getter1';
+ expected_source_line_text = ' return this.name; // getter 1';
+ debugger;
+ var x = c['getter1'];
+}
+
+function testGetter1_3() {
+ expected_function_name = 'getter1';
+ expected_source_line_text = ' return this.name; // getter 1';
+ debugger;
+ for (var i = 1; i < 2; i++) {
+ var x = c['getter' + i];
+ }
+}
+
+function testGetter1_4() {
+ expected_function_name = 'getter1';
+ expected_source_line_text = ' return this.name; // getter 1';
+ debugger;
+ var x = d.c.getter1;
+}
+
+function testGetter1_5() {
+ expected_function_name = 'getter1';
+ expected_source_line_text = ' return this.name; // getter 1';
+ for (var i = 2; i != 1; i--);
+ debugger;
+ var x = d.c['getter' + i];
+}
+
+function testGetter2_1() {
+ expected_function_name = 'getter2';
+ expected_source_line_text = ' return { // getter 2';
+ for (var i = 2; i != 1; i--);
+ debugger;
+ var t = d.c.getter2.name;
+}
+
+
+function testGetterY_1() {
+ expected_function_name = 'getterY';
+ expected_source_line_text = ' return this.name; // getter y';
+ debugger;
+ var t = d.c.y;
+}
+
+function testIndexedGetter3_1() {
+ expected_function_name = 'getter3';
+ expected_source_line_text = ' return this.name; // getter 3';
+ debugger;
+ var r = d.c[3];
+}
+
+function testSetterY_1() {
+ expected_function_name = 'setterY';
+ expected_source_line_text = ' this.name = n; // setter y';
+ debugger;
+ d.c.y = 'www';
+}
+
+function testIndexedSetter3_1() {
+ expected_function_name = 'setter3';
+ expected_source_line_text = ' this.name = n; // setter 3';
+ var i = 3
+ debugger;
+ d.c[3] = 'www';
+}
+
+function testSetter1_1() {
+ expected_function_name = 'setter1';
+ expected_source_line_text = ' this.name = n; // setter 1';
+ debugger;
+ d.c.setter1 = 'aa';
+}
+
+function testSetter1_2() {
+ expected_function_name = 'setter1';
+ expected_source_line_text = ' this.name = n; // setter 1';
+ debugger;
+ d.c['setter1'] = 'bb';
+}
+
+function testSetter1_3() {
+ expected_function_name = 'setter1';
+ expected_source_line_text = ' this.name = n; // setter 1';
+ for (var i = 2; i != 1; i--);
+ debugger;
+ d.c['setter' + i] = i;
+}
+
+var e = {
+ name: 'e'
+};
+e.__proto__ = c;
+
+function testProtoGetter1_1() {
+ expected_function_name = 'getter1';
+ expected_source_line_text = ' return this.name; // getter 1';
+ debugger;
+ var x = e.getter1;
+}
+
+function testProtoSetter1_1() {
+ expected_function_name = 'setter1';
+ expected_source_line_text = ' this.name = n; // setter 1';
+ debugger;
+ e.setter1 = 'aa';
+}
+
+function testProtoIndexedGetter3_1() {
+ expected_function_name = 'getter3';
+ expected_source_line_text = ' return this.name; // getter 3';
+ debugger;
+ var x = e[3];
+}
+
+function testProtoIndexedSetter3_1() {
+ expected_function_name = 'setter3';
+ expected_source_line_text = ' this.name = n; // setter 3';
+ debugger;
+ e[3] = 'new val';
+}
+
+function testProtoSetter1_2() {
+ expected_function_name = 'setter1';
+ expected_source_line_text = ' this.name = n; // setter 1';
+ for (var i = 2; i != 1; i--);
+ debugger;
+ e['setter' + i] = 'aa';
+}
+
+for (var n in this) {
+ if (n.substr(0, 4) != 'test') {
+ continue;
+ }
+ state = 1;
+ this[n]();
+ assertNull(exception);
+ assertEquals(3, state);
+}
+
+// Get rid of the debug event listener.
+Debug.setListener(null);
-// Copyright 2009 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Flags: --expose-debug-as debug\r
-\r
-// Get the Debug object exposed from the debug context global object.\r
-Debug = debug.Debug\r
-\r
-var exception = null;\r
-var state = 1;\r
-var expected_source_line_text = null;\r
-var expected_function_name = null;\r
-\r
-// Simple debug event handler which first time will cause 'step in' action\r
-// and than check that execution is paused inside function\r
-// expected_function_name.\r
-function listener(event, exec_state, event_data, data) {\r
- try {\r
- if (event == Debug.DebugEvent.Break) {\r
- if (state == 1) {\r
- exec_state.prepareStep(Debug.StepAction.StepIn, 2);\r
- state = 2;\r
- } else if (state == 2) {\r
- assertEquals(expected_function_name, event_data.func().name());\r
- assertEquals(expected_source_line_text,\r
- event_data.sourceLineText());\r
- state = 3;\r
- }\r
- }\r
- } catch(e) {\r
- exception = e;\r
- }\r
-};\r
-\r
-// Add the debug event listener.\r
-Debug.setListener(listener);\r
-\r
-var a = [1,2,3,4,5];\r
-\r
-// Test step into function call from a function without local variables.\r
-function testStepInArraySlice() {\r
- expected_function_name = 'testStepInArraySlice';\r
- expected_source_line_text = '} // expected line';\r
- debugger;\r
- var s = Array.prototype.slice.call(a, 2,3);\r
-} // expected line\r
-\r
-state = 1;\r
-testStepInArraySlice();\r
-assertNull(exception);\r
-assertEquals(3, state);\r
-\r
-// Get rid of the debug event listener.\r
-Debug.setListener(null);\r
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+var exception = null;
+var state = 1;
+var expected_source_line_text = null;
+var expected_function_name = null;
+
+// Simple debug event handler which first time will cause 'step in' action
+// and than check that execution is paused inside function
+// expected_function_name.
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ if (state == 1) {
+ exec_state.prepareStep(Debug.StepAction.StepIn, 2);
+ state = 2;
+ } else if (state == 2) {
+ assertEquals(expected_function_name, event_data.func().name());
+ assertEquals(expected_source_line_text,
+ event_data.sourceLineText());
+ state = 3;
+ }
+ }
+ } catch(e) {
+ exception = e;
+ }
+};
+
+// Add the debug event listener.
+Debug.setListener(listener);
+
+var a = [1,2,3,4,5];
+
+// Test step into function call from a function without local variables.
+function testStepInArraySlice() {
+ expected_function_name = 'testStepInArraySlice';
+ expected_source_line_text = '} // expected line';
+ debugger;
+ var s = Array.prototype.slice.call(a, 2,3);
+} // expected line
+
+state = 1;
+testStepInArraySlice();
+assertNull(exception);
+assertEquals(3, state);
+
+// Get rid of the debug event listener.
+Debug.setListener(null);
-// Copyright 2009 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Flags: --expose-debug-as debug\r
-// Get the Debug object exposed from the debug context global object.\r
-Debug = debug.Debug\r
-\r
-var exception = null;\r
-var state = 0;\r
-var expected_function_name = null;\r
-var expected_source_line_text = null;\r
-var expected_caller_source_line = null;\r
-var step_in_count = 2;\r
-\r
-// Simple debug event handler which first time will cause 'step in' action\r
-// to get into g.call and than check that execution is pauesed inside\r
-// function 'g'.\r
-function listener(event, exec_state, event_data, data) {\r
- try {\r
- if (event == Debug.DebugEvent.Break) {\r
- if (state == 0) {\r
- // Step into f().\r
- exec_state.prepareStep(Debug.StepAction.StepIn, step_in_count);\r
- state = 2;\r
- } else if (state == 2) {\r
- assertEquals(expected_source_line_text,\r
- event_data.sourceLineText());\r
- assertEquals(expected_function_name, event_data.func().name());\r
- state = 3;\r
- }\r
- }\r
- } catch(e) {\r
- exception = e;\r
- }\r
-};\r
-\r
-// Add the debug event listener.\r
-Debug.setListener(listener);\r
-\r
-\r
-function g() { \r
- return "s"; // expected line\r
-}\r
-\r
-function testFunction() {\r
- var f = g;\r
- var s = 1 +f(10);\r
-}\r
-\r
-function g2() { \r
- return "s2"; // expected line\r
-}\r
-\r
-function testFunction2() {\r
- var f = g2;\r
- var s = 1 +f(10, 20);\r
-}\r
-\r
-// Run three times. First time the function will be compiled lazily,\r
-// second time cached version will be used.\r
-for (var i = 0; i < 3; i++) {\r
- state = 0;\r
- expected_function_name = 'g';\r
- expected_source_line_text = ' return "s"; // expected line';\r
- step_in_count = 2;\r
- // Set a break point and call to invoke the debug event listener.\r
- Debug.setBreakPoint(testFunction, 1, 0);\r
- testFunction();\r
- assertNull(exception);\r
- assertEquals(3, state);\r
-}\r
-\r
-// Test stepping into function call when a breakpoint is set at the place\r
-// of call. Use different pair of functions so that g2 is compiled lazily.\r
-// Run twice: first time function will be compiled lazily, second time\r
-// cached version will be used.\r
-for (var i = 0; i < 3; i++) {\r
- state = 0;\r
- expected_function_name = 'g2';\r
- expected_source_line_text = ' return "s2"; // expected line';\r
- step_in_count = 1;\r
- // Set a break point and call to invoke the debug event listener.\r
- Debug.setBreakPoint(testFunction2, 2, 0);\r
- testFunction2();\r
- assertNull(exception);\r
- assertEquals(3, state);\r
-}\r
-\r
-\r
-// Get rid of the debug event listener.\r
-Debug.setListener(null);\r
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+var exception = null;
+var state = 0;
+var expected_function_name = null;
+var expected_source_line_text = null;
+var expected_caller_source_line = null;
+var step_in_count = 2;
+
+// Simple debug event handler which first time will cause 'step in' action
+// to get into g.call and than check that execution is pauesed inside
+// function 'g'.
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ if (state == 0) {
+ // Step into f().
+ exec_state.prepareStep(Debug.StepAction.StepIn, step_in_count);
+ state = 2;
+ } else if (state == 2) {
+ assertEquals(expected_source_line_text,
+ event_data.sourceLineText());
+ assertEquals(expected_function_name, event_data.func().name());
+ state = 3;
+ }
+ }
+ } catch(e) {
+ exception = e;
+ }
+};
+
+// Add the debug event listener.
+Debug.setListener(listener);
+
+
+function g() {
+ return "s"; // expected line
+}
+
+function testFunction() {
+ var f = g;
+ var s = 1 +f(10);
+}
+
+function g2() {
+ return "s2"; // expected line
+}
+
+function testFunction2() {
+ var f = g2;
+ var s = 1 +f(10, 20);
+}
+
+// Run three times. First time the function will be compiled lazily,
+// second time cached version will be used.
+for (var i = 0; i < 3; i++) {
+ state = 0;
+ expected_function_name = 'g';
+ expected_source_line_text = ' return "s"; // expected line';
+ step_in_count = 2;
+ // Set a break point and call to invoke the debug event listener.
+ Debug.setBreakPoint(testFunction, 1, 0);
+ testFunction();
+ assertNull(exception);
+ assertEquals(3, state);
+}
+
+// Test stepping into function call when a breakpoint is set at the place
+// of call. Use different pair of functions so that g2 is compiled lazily.
+// Run twice: first time function will be compiled lazily, second time
+// cached version will be used.
+for (var i = 0; i < 3; i++) {
+ state = 0;
+ expected_function_name = 'g2';
+ expected_source_line_text = ' return "s2"; // expected line';
+ step_in_count = 1;
+ // Set a break point and call to invoke the debug event listener.
+ Debug.setBreakPoint(testFunction2, 2, 0);
+ testFunction2();
+ assertNull(exception);
+ assertEquals(3, state);
+}
+
+
+// Get rid of the debug event listener.
+Debug.setListener(null);
-// Copyright 2008 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Flags: --expose-debug-as debug\r
-// Get the Debug object exposed from the debug context global object.\r
-Debug = debug.Debug\r
-\r
-var exception = null;\r
-var state = 0;\r
-\r
-// Simple debug event handler which first time will cause 'step in' action\r
-// to get into g.call and than check that execution is pauesed inside\r
-// function 'g'.\r
-function listener(event, exec_state, event_data, data) {\r
- try {\r
- if (event == Debug.DebugEvent.Break) {\r
- if (state == 0) {\r
- // Step into f2.call:\r
- exec_state.prepareStep(Debug.StepAction.StepIn, 2);\r
- state = 2;\r
- } else if (state == 2) {\r
- assertEquals('g', event_data.func().name());\r
- assertEquals(' return t + 1; // expected line',\r
- event_data.sourceLineText());\r
- state = 3;\r
- }\r
- }\r
- } catch(e) {\r
- exception = e;\r
- }\r
-};\r
-\r
-// Add the debug event listener.\r
-Debug.setListener(listener);\r
-\r
-\r
-// Sample functions.\r
-function g(t) {\r
- return t + 1; // expected line\r
-}\r
-\r
-// Test step into function call from a function without local variables.\r
-function call1() {\r
- debugger;\r
- g.call(null, 3);\r
-}\r
-\r
-\r
-// Test step into function call from a function with some local variables.\r
-function call2() {\r
- var aLocalVar = 'test';\r
- var anotherLocalVar = g(aLocalVar) + 's';\r
- var yetAnotherLocal = 10;\r
- debugger;\r
- g.call(null, 3);\r
-}\r
-\r
-// Test step into function call which is a part of an expression.\r
-function call3() {\r
- var alias = g;\r
- debugger;\r
- var r = 10 + alias.call(null, 3);\r
- var aLocalVar = 'test';\r
- var anotherLocalVar = g(aLocalVar) + 's';\r
- var yetAnotherLocal = 10;\r
-}\r
-\r
-// Test step into function call from a function with some local variables.\r
-function call4() {\r
- var alias = g;\r
- debugger;\r
- alias.call(null, 3);\r
- var aLocalVar = 'test';\r
- var anotherLocalVar = g(aLocalVar) + 's';\r
- var yetAnotherLocal = 10;\r
-}\r
-\r
-// Test step into function apply from a function without local variables.\r
-function apply1() {\r
- debugger;\r
- g.apply(null, [3]);\r
-}\r
-\r
-\r
-// Test step into function apply from a function with some local variables.\r
-function apply2() {\r
- var aLocalVar = 'test';\r
- var anotherLocalVar = g(aLocalVar) + 's';\r
- var yetAnotherLocal = 10;\r
- debugger;\r
- g.apply(null, [3, 4]);\r
-}\r
-\r
-// Test step into function apply which is a part of an expression.\r
-function apply3() {\r
- var alias = g;\r
- debugger;\r
- var r = 10 + alias.apply(null, [3, 'unused arg']);\r
- var aLocalVar = 'test';\r
- var anotherLocalVar = g(aLocalVar) + 's';\r
- var yetAnotherLocal = 10;\r
-}\r
-\r
-// Test step into function apply from a function with some local variables.\r
-function apply4() {\r
- var alias = g;\r
- debugger;\r
- alias.apply(null, [3]);\r
- var aLocalVar = 'test';\r
- var anotherLocalVar = g(aLocalVar) + 's';\r
- var yetAnotherLocal = 10;\r
-}\r
-\r
-var testFunctions =\r
- [call1, call2, call3, call4, apply1, apply2, apply3, apply4];\r
-\r
-for (var i = 0; i < testFunctions.length; i++) {\r
- state = 0;\r
- testFunctions[i]();\r
- assertNull(exception);\r
- assertEquals(3, state);\r
-}\r
-\r
-// Get rid of the debug event listener.\r
+// Copyright 2008 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+var exception = null;
+var state = 0;
+
+// Simple debug event handler which first time will cause 'step in' action
+// to get into g.call and than check that execution is pauesed inside
+// function 'g'.
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ if (state == 0) {
+ // Step into f2.call:
+ exec_state.prepareStep(Debug.StepAction.StepIn, 2);
+ state = 2;
+ } else if (state == 2) {
+ assertEquals('g', event_data.func().name());
+ assertEquals(' return t + 1; // expected line',
+ event_data.sourceLineText());
+ state = 3;
+ }
+ }
+ } catch(e) {
+ exception = e;
+ }
+};
+
+// Add the debug event listener.
+Debug.setListener(listener);
+
+
+// Sample functions.
+function g(t) {
+ return t + 1; // expected line
+}
+
+// Test step into function call from a function without local variables.
+function call1() {
+ debugger;
+ g.call(null, 3);
+}
+
+
+// Test step into function call from a function with some local variables.
+function call2() {
+ var aLocalVar = 'test';
+ var anotherLocalVar = g(aLocalVar) + 's';
+ var yetAnotherLocal = 10;
+ debugger;
+ g.call(null, 3);
+}
+
+// Test step into function call which is a part of an expression.
+function call3() {
+ var alias = g;
+ debugger;
+ var r = 10 + alias.call(null, 3);
+ var aLocalVar = 'test';
+ var anotherLocalVar = g(aLocalVar) + 's';
+ var yetAnotherLocal = 10;
+}
+
+// Test step into function call from a function with some local variables.
+function call4() {
+ var alias = g;
+ debugger;
+ alias.call(null, 3);
+ var aLocalVar = 'test';
+ var anotherLocalVar = g(aLocalVar) + 's';
+ var yetAnotherLocal = 10;
+}
+
+// Test step into function apply from a function without local variables.
+function apply1() {
+ debugger;
+ g.apply(null, [3]);
+}
+
+
+// Test step into function apply from a function with some local variables.
+function apply2() {
+ var aLocalVar = 'test';
+ var anotherLocalVar = g(aLocalVar) + 's';
+ var yetAnotherLocal = 10;
+ debugger;
+ g.apply(null, [3, 4]);
+}
+
+// Test step into function apply which is a part of an expression.
+function apply3() {
+ var alias = g;
+ debugger;
+ var r = 10 + alias.apply(null, [3, 'unused arg']);
+ var aLocalVar = 'test';
+ var anotherLocalVar = g(aLocalVar) + 's';
+ var yetAnotherLocal = 10;
+}
+
+// Test step into function apply from a function with some local variables.
+function apply4() {
+ var alias = g;
+ debugger;
+ alias.apply(null, [3]);
+ var aLocalVar = 'test';
+ var anotherLocalVar = g(aLocalVar) + 's';
+ var yetAnotherLocal = 10;
+}
+
+var testFunctions =
+ [call1, call2, call3, call4, apply1, apply2, apply3, apply4];
+
+for (var i = 0; i < testFunctions.length; i++) {
+ state = 0;
+ testFunctions[i]();
+ assertNull(exception);
+ assertEquals(3, state);
+}
+
+// Get rid of the debug event listener.
Debug.setListener(null);
\ No newline at end of file
-// Copyright 2009 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Flags: --expose-debug-as debug\r
-// Get the Debug object exposed from the debug context global object.\r
-Debug = debug.Debug\r
-\r
-var exception = null;\r
-var break_break_point_hit_count = 0;\r
-\r
-function listener(event, exec_state, event_data, data) {\r
- try {\r
- if (event == Debug.DebugEvent.Break) {\r
- if (break_break_point_hit_count == 0) {\r
- assertEquals(' debugger;',\r
- event_data.sourceLineText());\r
- assertEquals('runDoWhile', event_data.func().name());\r
- } else if (break_break_point_hit_count == 1) {\r
- assertEquals(' } while(condition());',\r
- event_data.sourceLineText());\r
- assertEquals('runDoWhile', event_data.func().name());\r
- }\r
-\r
- break_break_point_hit_count++;\r
- // Continue stepping until returned to bottom frame.\r
- if (exec_state.frameCount() > 1) {\r
- exec_state.prepareStep(Debug.StepAction.StepNext);\r
- }\r
-\r
- }\r
- } catch(e) {\r
- exception = e;\r
- }\r
-};\r
-\r
-// Add the debug event listener.\r
-Debug.setListener(listener);\r
-\r
-function condition() {\r
- return false;\r
-}\r
-\r
-function runDoWhile() {\r
- do {\r
- debugger;\r
- } while(condition());\r
-};\r
-\r
-break_break_point_hit_count = 0;\r
-runDoWhile();\r
-assertNull(exception);\r
-assertEquals(4, break_break_point_hit_count);\r
-\r
-// Get rid of the debug event listener.\r
-Debug.setListener(null);\r
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+var exception = null;
+var break_break_point_hit_count = 0;
+
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ if (break_break_point_hit_count == 0) {
+ assertEquals(' debugger;',
+ event_data.sourceLineText());
+ assertEquals('runDoWhile', event_data.func().name());
+ } else if (break_break_point_hit_count == 1) {
+ assertEquals(' } while(condition());',
+ event_data.sourceLineText());
+ assertEquals('runDoWhile', event_data.func().name());
+ }
+
+ break_break_point_hit_count++;
+ // Continue stepping until returned to bottom frame.
+ if (exec_state.frameCount() > 1) {
+ exec_state.prepareStep(Debug.StepAction.StepNext);
+ }
+
+ }
+ } catch(e) {
+ exception = e;
+ }
+};
+
+// Add the debug event listener.
+Debug.setListener(listener);
+
+function condition() {
+ return false;
+}
+
+function runDoWhile() {
+ do {
+ debugger;
+ } while(condition());
+};
+
+break_break_point_hit_count = 0;
+runDoWhile();
+assertNull(exception);
+assertEquals(4, break_break_point_hit_count);
+
+// Get rid of the debug event listener.
+Debug.setListener(null);
-// Copyright 2009 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Flags: --expose-debug-as debug\r
-// Get the Debug object exposed from the debug context global object.\r
-Debug = debug.Debug\r
-\r
-var exception = null;\r
-var step_out_count = 1;\r
-\r
-// Simple debug event handler which counts the number of breaks hit and steps.\r
-var break_point_hit_count = 0;\r
-function listener(event, exec_state, event_data, data) {\r
- try {\r
- if (event == Debug.DebugEvent.Break) {\r
- break_point_hit_count++;\r
- // Continue stepping until returned to bottom frame.\r
- if (exec_state.frameCount() > 1) {\r
- exec_state.prepareStep(Debug.StepAction.StepOut, step_out_count);\r
- }\r
-\r
- }\r
- } catch(e) {\r
- exception = e;\r
- }\r
-\r
-};\r
-\r
-function BeginTest(name) {\r
- test_name = name;\r
- break_point_hit_count = 0;\r
- exception = null;\r
-}\r
-\r
-function EndTest(expected_break_point_hit_count) {\r
- assertEquals(expected_break_point_hit_count, break_point_hit_count, test_name);\r
- assertNull(exception, test_name);\r
- test_name = null;\r
-}\r
-\r
-// Add the debug event listener.\r
-Debug.setListener(listener);\r
-\r
-\r
-var shouldBreak = null;\r
-function fact(x) {\r
- if (shouldBreak(x)) {\r
- debugger;\r
- }\r
- if (x < 2) {\r
- return 1;\r
- } else {\r
- return x*fact(x-1);\r
- }\r
-}\r
-\r
-BeginTest('Test 1');\r
-shouldBreak = function(x) { return x == 3; };\r
-step_out_count = 1;\r
-fact(3);\r
-EndTest(2);\r
-\r
-BeginTest('Test 2');\r
-shouldBreak = function(x) { return x == 2; };\r
-step_out_count = 1;\r
-fact(3);\r
-EndTest(3);\r
-\r
-BeginTest('Test 3');\r
-shouldBreak = function(x) { return x == 1; };\r
-step_out_count = 2;\r
-fact(3);\r
-EndTest(2);\r
-\r
-BeginTest('Test 4');\r
-shouldBreak = function(x) { print(x); return x == 1 || x == 3; };\r
-step_out_count = 2;\r
-fact(3);\r
-EndTest(3);\r
-\r
-// Get rid of the debug event listener.\r
-Debug.setListener(null);\r
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+var exception = null;
+var step_out_count = 1;
+
+// Simple debug event handler which counts the number of breaks hit and steps.
+var break_point_hit_count = 0;
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ break_point_hit_count++;
+ // Continue stepping until returned to bottom frame.
+ if (exec_state.frameCount() > 1) {
+ exec_state.prepareStep(Debug.StepAction.StepOut, step_out_count);
+ }
+
+ }
+ } catch(e) {
+ exception = e;
+ }
+
+};
+
+function BeginTest(name) {
+ test_name = name;
+ break_point_hit_count = 0;
+ exception = null;
+}
+
+function EndTest(expected_break_point_hit_count) {
+ assertEquals(expected_break_point_hit_count, break_point_hit_count, test_name);
+ assertNull(exception, test_name);
+ test_name = null;
+}
+
+// Add the debug event listener.
+Debug.setListener(listener);
+
+
+var shouldBreak = null;
+function fact(x) {
+ if (shouldBreak(x)) {
+ debugger;
+ }
+ if (x < 2) {
+ return 1;
+ } else {
+ return x*fact(x-1);
+ }
+}
+
+BeginTest('Test 1');
+shouldBreak = function(x) { return x == 3; };
+step_out_count = 1;
+fact(3);
+EndTest(2);
+
+BeginTest('Test 2');
+shouldBreak = function(x) { return x == 2; };
+step_out_count = 1;
+fact(3);
+EndTest(3);
+
+BeginTest('Test 3');
+shouldBreak = function(x) { return x == 1; };
+step_out_count = 2;
+fact(3);
+EndTest(2);
+
+BeginTest('Test 4');
+shouldBreak = function(x) { print(x); return x == 1 || x == 3; };
+step_out_count = 2;
+fact(3);
+EndTest(3);
+
+// Get rid of the debug event listener.
+Debug.setListener(null);
-// Copyright 2009 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Flags: --expose-debug-as debug\r
-\r
-// Get the Debug object exposed from the debug context global object.\r
-Debug = debug.Debug\r
-\r
-var exception = null;\r
-var state = 1;\r
-var expected_source_line_text = null;\r
-var expected_function_name = null;\r
-\r
-// Simple debug event handler which first time will cause 'step out' action\r
-// and than check that execution is paused inside function\r
-// expected_function_name.\r
-function listener(event, exec_state, event_data, data) {\r
- try {\r
- if (event == Debug.DebugEvent.Break) {\r
- if (state == 1) {\r
- exec_state.prepareStep(Debug.StepAction.StepOut, 2);\r
- state = 2;\r
- } else if (state == 2) {\r
- assertEquals(expected_function_name, event_data.func().name());\r
- assertEquals(expected_source_line_text,\r
- event_data.sourceLineText());\r
- state = 3;\r
- }\r
- }\r
- } catch(e) {\r
- exception = e;\r
- }\r
-};\r
-\r
-// Add the debug event listener.\r
-Debug.setListener(listener);\r
-\r
-var obj = {key:10};\r
-\r
-function replacer(key, value) {\r
- if (key == 'key') {\r
- debugger;\r
- }\r
- return value;\r
-}\r
-\r
-// Test step into function call from a function without local variables.\r
-function testStepOutToBuiltIn() {\r
- expected_function_name = 'testStepOutToBuiltIn';\r
- expected_source_line_text = '} // expected line';\r
- JSON.stringify(obj, replacer);\r
-} // expected line\r
-\r
-state = 1;\r
-testStepOutToBuiltIn();\r
-assertNull(exception);\r
-assertEquals(3, state);\r
-\r
-// Get rid of the debug event listener.\r
-Debug.setListener(null);\r
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+var exception = null;
+var state = 1;
+var expected_source_line_text = null;
+var expected_function_name = null;
+
+// Simple debug event handler which first time will cause 'step out' action
+// and than check that execution is paused inside function
+// expected_function_name.
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ if (state == 1) {
+ exec_state.prepareStep(Debug.StepAction.StepOut, 2);
+ state = 2;
+ } else if (state == 2) {
+ assertEquals(expected_function_name, event_data.func().name());
+ assertEquals(expected_source_line_text,
+ event_data.sourceLineText());
+ state = 3;
+ }
+ }
+ } catch(e) {
+ exception = e;
+ }
+};
+
+// Add the debug event listener.
+Debug.setListener(listener);
+
+var obj = {key:10};
+
+function replacer(key, value) {
+ if (key == 'key') {
+ debugger;
+ }
+ return value;
+}
+
+// Test step into function call from a function without local variables.
+function testStepOutToBuiltIn() {
+ expected_function_name = 'testStepOutToBuiltIn';
+ expected_source_line_text = '} // expected line';
+ JSON.stringify(obj, replacer);
+} // expected line
+
+state = 1;
+testStepOutToBuiltIn();
+assertNull(exception);
+assertEquals(3, state);
+
+// Get rid of the debug event listener.
+Debug.setListener(null);
-// Copyright 2009 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-\r
-// Flags: --expose-natives_as natives\r
-// Test keyed access to deleted property in a global object without access checks.\r
-// Regression test that exposed the_hole value from Runtime_KeyedGetPoperty.\r
-\r
-var name = "fisk";\r
-natives[name] = name;\r
-function foo() { natives[name] + 12; }\r
-for(var i = 0; i < 3; i++) foo(); \r
-delete natives[name];\r
-for(var i = 0; i < 3; i++) foo();\r
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+// Flags: --expose-natives_as natives
+// Test keyed access to deleted property in a global object without access checks.
+// Regression test that exposed the_hole value from Runtime_KeyedGetPoperty.
+
+var name = "fisk";
+natives[name] = name;
+function foo() { natives[name] + 12; }
+for(var i = 0; i < 3; i++) foo();
+delete natives[name];
+for(var i = 0; i < 3; i++) foo();
-// Copyright 2009 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// Tests from http://blog.stevenlevithan.com/archives/npcg-javascript\r
-\r
-assertEquals(true, /(x)?\1y/.test("y"));\r
-assertEquals(["y", undefined], /(x)?\1y/.exec("y"));\r
-assertEquals(["y", undefined], /(x)?y/.exec("y"));\r
-assertEquals(["y", undefined], "y".match(/(x)?\1y/));\r
-assertEquals(["y", undefined], "y".match(/(x)?y/));\r
-assertEquals(["y"], "y".match(/(x)?\1y/g));\r
-assertEquals(["", undefined, ""], "y".split(/(x)?\1y/));\r
-assertEquals(["", undefined, ""], "y".split(/(x)?y/));\r
-assertEquals(0, "y".search(/(x)?\1y/));\r
-assertEquals("z", "y".replace(/(x)?\1y/, "z"));\r
-assertEquals("", "y".replace(/(x)?y/, "$1"));\r
-assertEquals("undefined", "y".replace(/(x)?\1y/,\r
- function($0, $1){ \r
- return String($1); \r
- }));\r
-assertEquals("undefined", "y".replace(/(x)?y/, \r
- function($0, $1){ \r
- return String($1); \r
- }));\r
-assertEquals("undefined", "y".replace(/(x)?y/, \r
- function($0, $1){ \r
- return $1; \r
- }));\r
-\r
-// See https://bugzilla.mozilla.org/show_bug.cgi?id=476146\r
-assertEquals("bbc,b", /^(b+|a){1,2}?bc/.exec("bbc"));\r
-assertEquals("bbaa,a,,a", /((\3|b)\2(a)){2,}/.exec("bbaababbabaaaaabbaaaabba"));\r
-\r
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Tests from http://blog.stevenlevithan.com/archives/npcg-javascript
+
+assertEquals(true, /(x)?\1y/.test("y"));
+assertEquals(["y", undefined], /(x)?\1y/.exec("y"));
+assertEquals(["y", undefined], /(x)?y/.exec("y"));
+assertEquals(["y", undefined], "y".match(/(x)?\1y/));
+assertEquals(["y", undefined], "y".match(/(x)?y/));
+assertEquals(["y"], "y".match(/(x)?\1y/g));
+assertEquals(["", undefined, ""], "y".split(/(x)?\1y/));
+assertEquals(["", undefined, ""], "y".split(/(x)?y/));
+assertEquals(0, "y".search(/(x)?\1y/));
+assertEquals("z", "y".replace(/(x)?\1y/, "z"));
+assertEquals("", "y".replace(/(x)?y/, "$1"));
+assertEquals("undefined", "y".replace(/(x)?\1y/,
+ function($0, $1){
+ return String($1);
+ }));
+assertEquals("undefined", "y".replace(/(x)?y/,
+ function($0, $1){
+ return String($1);
+ }));
+assertEquals("undefined", "y".replace(/(x)?y/,
+ function($0, $1){
+ return $1;
+ }));
+
+// See https://bugzilla.mozilla.org/show_bug.cgi?id=476146
+assertEquals("bbc,b", /^(b+|a){1,2}?bc/.exec("bbc"));
+assertEquals("bbaa,a,,a", /((\3|b)\2(a)){2,}/.exec("bbaababbabaaaaabbaaaabba"));
+
-// Copyright 2008 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-// See: http://code.google.com/p/v8/issues/detail?id=246\r
-\r
-assertTrue(/(?:text)/.test("text"));\r
+// Copyright 2008 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// See: http://code.google.com/p/v8/issues/detail?id=246
+
+assertTrue(/(?:text)/.test("text"));
assertEquals(["text"], /(?:text)/.exec("text"));
\ No newline at end of file
-// Copyright 2010 the V8 project authors. All rights reserved.\r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are\r
-// met:\r
-//\r
-// * Redistributions of source code must retain the above copyright\r
-// notice, this list of conditions and the following disclaimer.\r
-// * Redistributions in binary form must reproduce the above\r
-// copyright notice, this list of conditions and the following\r
-// disclaimer in the documentation and/or other materials provided\r
-// with the distribution.\r
-// * Neither the name of Google Inc. nor the names of its\r
-// contributors may be used to endorse or promote products derived\r
-// from this software without specific prior written permission.\r
-//\r
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-\r
-// Flags: --expose-natives_as natives\r
-// Test the SameValue internal method.\r
-\r
-var obj1 = {x: 10, y: 11, z: "test"};\r
-var obj2 = {x: 10, y: 11, z: "test"};\r
-\r
-assertTrue(natives.SameValue(0, 0));\r
-assertTrue(natives.SameValue(+0, +0));\r
-assertTrue(natives.SameValue(-0, -0));\r
-assertTrue(natives.SameValue(1, 1));\r
-assertTrue(natives.SameValue(2, 2));\r
-assertTrue(natives.SameValue(-1, -1));\r
-assertTrue(natives.SameValue(0.5, 0.5));\r
-assertTrue(natives.SameValue(true, true));\r
-assertTrue(natives.SameValue(false, false));\r
-assertTrue(natives.SameValue(NaN, NaN));\r
-assertTrue(natives.SameValue(null, null));\r
-assertTrue(natives.SameValue("foo", "foo"));\r
-assertTrue(natives.SameValue(obj1, obj1));\r
-// Undefined values.\r
-assertTrue(natives.SameValue());\r
-assertTrue(natives.SameValue(undefined, undefined));\r
-\r
-assertFalse(natives.SameValue(0,1));\r
-assertFalse(natives.SameValue("foo", "bar"));\r
-assertFalse(natives.SameValue(obj1, obj2));\r
-assertFalse(natives.SameValue(true, false));\r
-\r
-assertFalse(natives.SameValue(obj1, true));\r
-assertFalse(natives.SameValue(obj1, "foo"));\r
-assertFalse(natives.SameValue(obj1, 1));\r
-assertFalse(natives.SameValue(obj1, undefined));\r
-assertFalse(natives.SameValue(obj1, NaN));\r
-\r
-assertFalse(natives.SameValue(undefined, true));\r
-assertFalse(natives.SameValue(undefined, "foo"));\r
-assertFalse(natives.SameValue(undefined, 1));\r
-assertFalse(natives.SameValue(undefined, obj1));\r
-assertFalse(natives.SameValue(undefined, NaN));\r
-\r
-assertFalse(natives.SameValue(NaN, true));\r
-assertFalse(natives.SameValue(NaN, "foo"));\r
-assertFalse(natives.SameValue(NaN, 1));\r
-assertFalse(natives.SameValue(NaN, obj1));\r
-assertFalse(natives.SameValue(NaN, undefined));\r
-\r
-assertFalse(natives.SameValue("foo", true));\r
-assertFalse(natives.SameValue("foo", 1));\r
-assertFalse(natives.SameValue("foo", obj1));\r
-assertFalse(natives.SameValue("foo", undefined));\r
-assertFalse(natives.SameValue("foo", NaN));\r
-\r
-assertFalse(natives.SameValue(true, 1));\r
-assertFalse(natives.SameValue(true, obj1));\r
-assertFalse(natives.SameValue(true, undefined));\r
-assertFalse(natives.SameValue(true, NaN));\r
-assertFalse(natives.SameValue(true, "foo"));\r
-\r
-assertFalse(natives.SameValue(1, true));\r
-assertFalse(natives.SameValue(1, obj1));\r
-assertFalse(natives.SameValue(1, undefined));\r
-assertFalse(natives.SameValue(1, NaN));\r
-assertFalse(natives.SameValue(1, "foo"));\r
-\r
-// Special string cases.\r
-assertFalse(natives.SameValue("1", 1));\r
-assertFalse(natives.SameValue("true", true));\r
-assertFalse(natives.SameValue("false", false));\r
-assertFalse(natives.SameValue("undefined", undefined));\r
-assertFalse(natives.SameValue("NaN", NaN));\r
-\r
-// -0 and +0 are should be different\r
-assertFalse(natives.SameValue(+0, -0));\r
-assertFalse(natives.SameValue(-0, +0));\r
+// Copyright 2010 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+// Flags: --expose-natives_as natives
+// Test the SameValue internal method.
+
+var obj1 = {x: 10, y: 11, z: "test"};
+var obj2 = {x: 10, y: 11, z: "test"};
+
+assertTrue(natives.SameValue(0, 0));
+assertTrue(natives.SameValue(+0, +0));
+assertTrue(natives.SameValue(-0, -0));
+assertTrue(natives.SameValue(1, 1));
+assertTrue(natives.SameValue(2, 2));
+assertTrue(natives.SameValue(-1, -1));
+assertTrue(natives.SameValue(0.5, 0.5));
+assertTrue(natives.SameValue(true, true));
+assertTrue(natives.SameValue(false, false));
+assertTrue(natives.SameValue(NaN, NaN));
+assertTrue(natives.SameValue(null, null));
+assertTrue(natives.SameValue("foo", "foo"));
+assertTrue(natives.SameValue(obj1, obj1));
+// Undefined values.
+assertTrue(natives.SameValue());
+assertTrue(natives.SameValue(undefined, undefined));
+
+assertFalse(natives.SameValue(0,1));
+assertFalse(natives.SameValue("foo", "bar"));
+assertFalse(natives.SameValue(obj1, obj2));
+assertFalse(natives.SameValue(true, false));
+
+assertFalse(natives.SameValue(obj1, true));
+assertFalse(natives.SameValue(obj1, "foo"));
+assertFalse(natives.SameValue(obj1, 1));
+assertFalse(natives.SameValue(obj1, undefined));
+assertFalse(natives.SameValue(obj1, NaN));
+
+assertFalse(natives.SameValue(undefined, true));
+assertFalse(natives.SameValue(undefined, "foo"));
+assertFalse(natives.SameValue(undefined, 1));
+assertFalse(natives.SameValue(undefined, obj1));
+assertFalse(natives.SameValue(undefined, NaN));
+
+assertFalse(natives.SameValue(NaN, true));
+assertFalse(natives.SameValue(NaN, "foo"));
+assertFalse(natives.SameValue(NaN, 1));
+assertFalse(natives.SameValue(NaN, obj1));
+assertFalse(natives.SameValue(NaN, undefined));
+
+assertFalse(natives.SameValue("foo", true));
+assertFalse(natives.SameValue("foo", 1));
+assertFalse(natives.SameValue("foo", obj1));
+assertFalse(natives.SameValue("foo", undefined));
+assertFalse(natives.SameValue("foo", NaN));
+
+assertFalse(natives.SameValue(true, 1));
+assertFalse(natives.SameValue(true, obj1));
+assertFalse(natives.SameValue(true, undefined));
+assertFalse(natives.SameValue(true, NaN));
+assertFalse(natives.SameValue(true, "foo"));
+
+assertFalse(natives.SameValue(1, true));
+assertFalse(natives.SameValue(1, obj1));
+assertFalse(natives.SameValue(1, undefined));
+assertFalse(natives.SameValue(1, NaN));
+assertFalse(natives.SameValue(1, "foo"));
+
+// Special string cases.
+assertFalse(natives.SameValue("1", 1));
+assertFalse(natives.SameValue("true", true));
+assertFalse(natives.SameValue("false", false));
+assertFalse(natives.SameValue("undefined", undefined));
+assertFalse(natives.SameValue("NaN", NaN));
+
+// -0 and +0 are should be different
+assertFalse(natives.SameValue(+0, -0));
+assertFalse(natives.SameValue(-0, +0));