Generating asynchronous runtime compatibility in javascript applications

Uložené v:
Podrobná bibliografia
Názov: Generating asynchronous runtime compatibility in javascript applications
Patent Number: 10552,128
Dátum vydania: February 04, 2020
Appl. No: 15/854133
Application Filed: December 26, 2017
Abstrakt: Methods and computer-readable media are disclosed herein for generating asynchronous runtime compatible applications from non-asynchronous applications. In embodiments, source code for the application that is not compatible with asynchronous processing is examined. The source code is parsed in order to identify unsafe functions that will cause failures of the application when processed in an asynchronous runtime. The source code corresponding to those unsafe functions is modified by adding asynchronous functions and commands to the source code and restructuring the source code. The modified source code may then be provided to an asynchronous runtime environment as the application is now compatible with asynchronous processing.
Inventors: CERNER INNOVATION, INC. (Kansas City, KS, US)
Assignees: CERNER INNOVATON, INC. (Kansas City, KS, US)
Claim: 1. A computerized method comprising: obtaining source code for an application; parsing the source code to identify a function that is encoded for execution via synchronous processing; determining that the identified function is unsafe when the identified function relies on a specific sequence of job processing in a runtime environment that fails when executed via asynchronous processing, wherein determining comprises: identifying that the identified function is a parent function; determine that the parent function is unsafe as having a dependency on execution of a child function; and marking the parent function for modification; modifying the identified function in the source code based on determining the identified function is unsafe, wherein modifying the identified function comprises automatically encoding one or more asynchronous functions into the source code corresponding to the marked parent function; and storing the source code having the modified function, wherein the modified function succeeds when executed via asynchronous processing based on the one or more asynchronous functions.
Claim: 2. The method of claim 1 , further comprising: using an index of unsafe functions to determine the identified function is unsafe.
Claim: 3. The method of claim 1 , further comprising: updating an index of unsafe functions by adding the identified function determined to be unsafe to the index of unsafe functions.
Claim: 4. The method of claim 1 , further comprising: storing the source code, as unmodified, in a code base.
Claim: 5. The method of claim 4 , further comprising: providing the source code, as unmodified, to a synchronous runtime environment; and providing the source code having the modified function to an asynchronous runtime environment.
Claim: 6. One or more non-transitory computer-readable media having computer-executable instructions embodied thereon that, when executed, perform a method comprising: obtaining source code for an application that is not compatible with asynchronous processing; parsing the source code to identify functions; determining that a plurality of the identified functions are unsafe when the identified function relies on a specific sequence of job processing in a runtime environment that fails when executed via asynchronous processing, wherein determining comprises: identifying at least one parent function in the plurality of identified functions; determine the at least one parent function is unsafe based on the at least one parent function having a dependency on execution of at least one child function; and marking the at least one parent function for modification; modifying the source code corresponding to each of the plurality of functions based on determining the plurality of functions are unsafe, wherein modifying the source code corresponding to each of the plurality of functions comprises automatically encoding one or more asynchronous functions into the source code corresponding to the marked at least one parent function; and storing the modified source code in a new location in a code base, wherein the modified source code is compatible with asynchronous processing based on the one or more asynchronous functions.
Claim: 7. The media of claim 6 , wherein parsing the source code to identify functions comprises: parsing the source code into syntax trees; decompiling each of the syntax trees subsequent to modifying the source code; and storing the decompiled and modified source code for the application in a code base.
Claim: 8. The media of claim 6 , wherein the one or more asynchronous functions include an async function and an await command.
Claim: 9. The media of claim 6 , wherein the one or more asynchronous functions comprise a callback function.
Claim: 10. The media of claim 6 , wherein the method further comprises: parsing the source code into syntax trees; wherein modifying the plurality of functions comprises modifying each of the syntax trees; and decompiling each of the syntax trees subsequent to modifying the source code.
Claim: 11. The media of claim 6 , wherein determining that the plurality of functions are unsafe comprises: for each of the plurality of functions: identifying a name of the function; querying an index of unsafe functions using the name of the function; and when the name of the function is present in the index of unsafe functions, determining the function is unsafe.
Claim: 12. One or more non-transitory computer-readable media having computer-executable instructions embodied thereon that, when executed, perform a method comprising: obtaining source code for an application that is not compatible with asynchronous processing; parsing the source code to identify functions; determining that a plurality of functions are unsafe functions when the identified function relies on a specific sequence of job processing in a runtime environment that fails when executed via asynchronous processing, wherein determining comprises: identifying at least one parent function in the plurality of functions; determine the at least one parent function is unsafe based on the at least one parent function having a dependency on execution of at least one child function; and marking the at least one parent function for modification; modifying the source code corresponding to each of the plurality of unsafe functions based on determining the plurality of functions are unsafe functions, wherein modifying the source code corresponding to each of the plurality of functions comprises automatically encoding a plurality of asynchronous functions into the source code corresponding to the marked at least one parent function; storing the modified source code as a new version of the application in a code base, wherein the modified source code is compatible with asynchronous processing based on the plurality of asynchronous functions; and providing the modified source code for the application to an asynchronous runtime environment for processing.
Claim: 13. The media of claim 12 , the method further comprising: executing the modified source code for the application using the asynchronous runtime environment.
Claim: 14. The media of claim 12 , wherein the plurality of asynchronous functions include an async function and an await command.
Claim: 15. The media of claim 14 , wherein when the modified source code for the application is executed using the asynchronous runtime environment, the async function holds execution of processing of each of the plurality of functions until an await command is resolved.
Claim: 16. The media of claim 14 , wherein when the modified source code for the application is executed using the asynchronous runtime environment, the await command instructs the asynchronous runtime environment to wait until a value is returned for an underlying function before processing each of the plurality of functions.
Claim: 17. The media of claim 12 , wherein the plurality of asynchronous functions include a call back function, and wherein when the modified source code for the application is executed using the asynchronous runtime environment, the callback function is not executed until an async function is executed.
Patent References Cited: 6195676 February 2001 Spix
9176731 November 2015 Ziftci
2003/0028864 February 2003 Bowen
2005/0246716 November 2005 Smith
2009/0055812 February 2009 Smith
2011/0173600 July 2011 Thompson
2012/0198424 August 2012 Kandasamy
2015/0370551 December 2015 Mahajan
2018/0046956 February 2018 Marcu
2018/0189115 July 2018 Abdallah
2018/0210709 July 2018 Bharthulwar
2018/0267868 September 2018 Bose
Other References: Title: OBBTree: A hierarchical structure for rapid interference detection, author: S Gottschalk et al, published 1996. cited by examiner
Primary Examiner: Das, Chameli
Attorney, Agent or Firm: Shook, Hardy & Bacon L.L.P.
Prístupové číslo: edspgr.10552128
Databáza: USPTO Patent Grants
Popis
Abstrakt:Methods and computer-readable media are disclosed herein for generating asynchronous runtime compatible applications from non-asynchronous applications. In embodiments, source code for the application that is not compatible with asynchronous processing is examined. The source code is parsed in order to identify unsafe functions that will cause failures of the application when processed in an asynchronous runtime. The source code corresponding to those unsafe functions is modified by adding asynchronous functions and commands to the source code and restructuring the source code. The modified source code may then be provided to an asynchronous runtime environment as the application is now compatible with asynchronous processing.