Browse Prior Art Database

Method and System for Debugging Inline Conditional Statements or Ternary Operators

IP.com Disclosure Number: IPCOM000252834D
Publication Date: 2018-Feb-15
Document File: 2 page(s) / 8K

Publishing Venue

The IP.com Prior Art Database

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 64% of the total text.

Method and System for Debugging Inline Conditional Statements or Ternary Operators

Disclosed is a method and system for debugging inline conditional statements or ternary operators. The method and system provides tools that are used on code editors which help developers write clear Conditional statements with Ternary operators. Further, the method and system provides a way to expand a ternary conditional to if else statements and also reverses it by creating a ternary conditional from an if/else statement. The method and system also enables a debugger to identify and step through Ternary operator code by identifying the conditional byte code at run time, and making it possible to step through each conditional statement and finding the intermediate values / states. Further, the method and system enables the code editor to automatically expand the ternary conditionals to normal if/else blocks and to step through the normal if/else blocks. An implementation of the method and system is further described as follows. Consider the following Ternary Conditional, var now = new Date(); var greeting = "Good" + ((now.getHours() > 17) ? " evening." : " day."); Expanded if/else var greeting = "Good"; if (now.getHours() > 17) greeting += " evening."; else greeting += " day."; Considering a Case 1, a code refactor plugin identifies a ternary operator if it looks for character '?'. Once the ternary operator is identified, the code refactor plugin decomposes the ternary operator into if/else...