Runtime code replacement
AssigneeInternational Business Machines Corporation
InventorsGareth E. Jones, James Thomas
Life of this patent
Estimating the term…
Abstract
Runtime code replacement at a client-side Web application is provided, and preferably comprises: determining that source code of a Web application has been updated at a server; retrieving the updated source code; and replacing existing runtime code at a running client-side Web application with the updated source code. Replacing existing runtime code may replace live objects in a memory of a Web browser on which the client-side Web application is running, without requiring a restart of the client-side application.
Claims15
A method for runtime code replacement at a client-side Web application, the method comprising:
- determining that source script code used in a Web application running on a client browser has been updated at a server;
- sending a request from the Web application to the server to request retrieving the updated source script code used in the Web application from the server to the client;
- receiving the requested updated source script code at the client;
- and
- replacing an existing runtime version of the source script code used in the Web application, while the Web application continues running on the client browser, with the updated source script code without requiring a restart of the running Web application, further comprising:
- creating at least one new object, as required to implement the updated source script code;
- locating each of at least one object corresponding to the existing runtime version;
- removing any located object for which the creating did not create a corresponding new object;
- and
- for each remaining located object, using a new prototype of a corresponding one of the at least one new object as a replacement for an existing prototype of the located object, the new prototype determined from the updated source script code, further comprising:
- determining each of at least one property of the located object;
- and
- storing a copy of a value of each determined property of the located object into a corresponding property of the corresponding new object.
A system for runtime code replacement at a client-side Web application, the system comprising:
- a computer comprising a processor;
- and
- instructions which are executable, using the processor, to perform functions comprising:
- determining that source script code used in a Web application running on a client browser has been updated at a server;
- sending a request from the Web application to the server to request retrieving the updated source script code used in the Web application from the server to the client;
- receiving the requested updated source script code at the client;
- and
- replacing an existing runtime version of the source script code used in the Web application, while the Web application continues running on the client browser, with the updated source script code without requiring a restart of the running Web application, further comprising:
- creating at least one new object, as required to implement the updated source script code;
- locating each of at least one object corresponding to the existing runtime version;
- removing any located object for which the creating did not create a corresponding new object;
- and
- for each remaining located object, using a new prototype of a corresponding one of the at least one new object as a replacement for an existing prototype of the located object, the new prototype determined from the updated source script code, further comprising:
- determining each of at least one property of the located object;
- and
- storing a copy of a value of each determined property of the located object into a corresponding property of the corresponding new object.
A computer program product stored on a non-transitory computer-readable medium and loadable into an internal memory of a digital computer, the computer program comprising computer-readable program code for causing the digital computer to perform:
- determining that source script code used in a Web application running on a client browser has been updated at a server;
- sending a request from the Web application to the server to request retrieving the updated source script code used in the Web application from the server to the client;
- receiving the requested updated source script code at the client;
- and
- replacing an existing runtime version of the source script code used in the Web application, while the Web application continues running on the client browser, with the updated source script code without requiring a restart of the running Web application, further comprising:
- creating at least one new object, as required to implement the updated source script code;
- locating each of at least one object corresponding to the existing runtime version;
- removing any located object for which the creating did not create a corresponding new object;
- and
- for each remaining located object, using a new prototype of a corresponding one of the at least one new object as a replacement for an existing prototype of the located object, the new prototype determined from the updated source script code, further comprising:
- determining each of at least one property of the located object;
- and
- storing a copy of a value of each determined property of the located object into a corresponding property of the corresponding new object.
Dependencies are inferred from the claim text.