[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN104991866A - Debugging method and device of JS program - Google Patents

Debugging method and device of JS program Download PDF

Info

Publication number
CN104991866A
CN104991866A CN201510461325.4A CN201510461325A CN104991866A CN 104991866 A CN104991866 A CN 104991866A CN 201510461325 A CN201510461325 A CN 201510461325A CN 104991866 A CN104991866 A CN 104991866A
Authority
CN
China
Prior art keywords
program
debugged
adduction relationship
script file
analysis result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510461325.4A
Other languages
Chinese (zh)
Other versions
CN104991866B (en
Inventor
耿利达
张建杰
吕利军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guoxing Network Co ltd
Original Assignee
Xinhua Reed (beijing) Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xinhua Reed (beijing) Network Technology Co Ltd filed Critical Xinhua Reed (beijing) Network Technology Co Ltd
Priority to CN201510461325.4A priority Critical patent/CN104991866B/en
Publication of CN104991866A publication Critical patent/CN104991866A/en
Application granted granted Critical
Publication of CN104991866B publication Critical patent/CN104991866B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a debugging method and device of a JS program. The method includes the following steps that: the script file analytical result of a loaded JS program to be debugged is obtained; the obtained script file analytical result is removed; when the program requires debugging, the JS program to be debugged is loaded again; and the JS program to be debugged is debugged according to a re-loading result. With the debugging method and device of the invention adopted, the technical problem of inconvenient debugging of a Node.js program due to modification can be solved.

Description

The adjustment method of JS program and device
Technical field
The present invention relates to computer realm, in particular to a kind of adjustment method and device of JS program.
Background technology
When developing Node.js program and realizing HTTP application, no matter have modified which part code of program, all first must stop current Node.js process, and then restart, like this, the content of amendment just can be proved effective.This is because: when being cited when there is no special distributing rationally with PHP at every turn, system all can program code read analyzing script file is different again, Node.js program is only when first time is cited, system just understands program code read and analyzing script file, storing and resolving result simultaneously, if make follow-uply to quote this Node.js program again, then can direct access memory, avoid program to repeat to be loaded into.
But, although this design proposal of Node.js is conducive to improving system performance, be unfavorable for checking amendment effect and exploitation debugging.Because: on stream, user more sees amendment effect after desired modifications program immediately, instead of all will first stop process at every turn and restart, just can check amendment effect.Also namely, as long as have modified JS file, as amendment debug function, or increase other functions, just need release process again, particularly, each amendment all needs to perform following two steps: control+c, node server.js.
In the related, the debugging plan such as node-supervisor, PM2 and node-dev are provided.But these solutions all need, listening to after JS file is modified, to restart Node.js process, cause debugging inconvenience.
For above-mentioned problem, at present effective solution is not yet proposed.
Summary of the invention
Embodiments provide a kind of adjustment method and device of JS program, cause debugging inconvenient technical matters due to amendment at least to solve Node.js program.
According to an aspect of the embodiment of the present invention, provide a kind of adjustment method of JS program, comprising: the script file analysis result obtaining the JS program to be debugged loaded; Remove the above-mentioned script file analysis result obtained; When needs debugged program, again load above-mentioned JS program to be debugged; According to the above-mentioned JS program to be debugged of the debugging of loading result again.
Further, before the script file analysis result obtaining the JS program to be debugged loaded, said method also comprises: whether the part or all of code detected in above-mentioned JS program to be debugged is modified, if be modified, then perform the step of the script file analysis result obtaining the JS program to be debugged loaded.
Further, whether the part or all of code detected in above-mentioned JS program to be debugged has been modified and has comprised: whether the JS file monitoring the renewal of needs heat is changed; And/or detect whether editing machine has triggered removing script file analysis result trigger mechanism when preserving file.
Further, the means of editing machine trigger mechanism of triggering removing script file analysis result when preserving file comprise: editing machine sends trigger pip when preserving file to the process that above-mentioned JS program to be debugged is corresponding; And/or the URL specified accessed by editing machine when preserving file.
Further, while removing the above-mentioned script file analysis result obtained, said method also comprises: the adduction relationship of the above-mentioned script file that release obtains.
Further, before the adduction relationship of the above-mentioned script file of release acquisition, said method comprises: detect above-mentioned adduction relationship and whether comprise adduction relationship except the adduction relationship of the process corresponding with above-mentioned JS program to be debugged, wherein, if do not comprise, then perform the step of the adduction relationship of the above-mentioned script file that release obtains.
Further, after whether the above-mentioned adduction relationship of detection comprises the adduction relationship except the adduction relationship of the process corresponding with above-mentioned JS program to be debugged, said method comprises: if comprise, then do not perform the step of the adduction relationship of the above-mentioned script file that release obtains; If or comprise, whether the dormancy time of the process then further having detected above-mentioned adduction relationship except the adduction relationship of the process corresponding with above-mentioned JS program to be debugged identified exceeds threshold value, if exceed threshold value, then perform the step of the adduction relationship of the above-mentioned script file that release obtains, if do not exceed threshold value, then do not perform the step of the adduction relationship of the above-mentioned script file that release obtains.
According to the another aspect of the embodiment of the present invention, additionally provide a kind of debugging apparatus of JS program, comprising: acquiring unit, for obtaining the script file analysis result of the JS program to be debugged loaded; Clearing cell, for removing the above-mentioned script file analysis result of acquisition; Loading unit, for when needs debugged program, loads above-mentioned JS program to be debugged again; Debugging unit, for the basis above-mentioned JS program to be debugged of loading result debugging again.
Further, said apparatus also comprises: the first detecting unit, for before the script file analysis result obtaining the JS program to be debugged loaded, whether the part or all of code detected in above-mentioned JS program to be debugged is modified, when being modified, perform the function that above-mentioned acquiring unit obtains the script file analysis result of the JS program to be debugged loaded.
Whether further, above-mentioned first detecting unit comprises: monitor module, change for monitoring the JS file needing heat to upgrade; And/or detection module, whether trigger for detecting editing machine the trigger mechanism removing script file analysis result when preserving file.
Further, said apparatus also comprises trigger element, above-mentioned trigger element triggers the object of the trigger mechanism removing script file analysis result when preserving file for realizing editing machine, wherein, above-mentioned trigger element comprises: send signal trigger module, sends trigger pip for editing machine when preserving file to the process that above-mentioned JS program to be debugged is corresponding; And/or access URL trigger module, access the URL specified when preserving file for editing machine.
Further, said apparatus comprises: releasing unit, for while removing the above-mentioned script file analysis result obtained, and the adduction relationship of the above-mentioned script file that release obtains.
Further, said apparatus also comprises: the second detecting unit, for before the adduction relationship of the above-mentioned script file of release acquisition, detect above-mentioned adduction relationship and whether comprise adduction relationship except the adduction relationship of the process corresponding with above-mentioned JS program to be debugged, wherein, when not comprising, perform the function of the adduction relationship of the above-mentioned script file that the release of above-mentioned releasing unit obtains.
Further, said apparatus comprises: after whether the above-mentioned adduction relationship of detection comprises the adduction relationship except the adduction relationship of the process corresponding with above-mentioned JS program to be debugged, when comprising, do not perform the function of the adduction relationship of the above-mentioned script file that the release of above-mentioned releasing unit obtains; Or when comprising, second detecting unit, whether the dormancy time for the process having detected above-mentioned adduction relationship except the adduction relationship of the process corresponding with above-mentioned JS program to be debugged further identified exceeds threshold value, when exceeding threshold value, perform the step of the adduction relationship of the above-mentioned script file that the release of above-mentioned releasing unit obtains, when not exceeding threshold value, do not perform the step of the adduction relationship of the above-mentioned script file that the release of above-mentioned releasing unit obtains.
In embodiments of the present invention, adopt the mode of the script file analysis result removing the buffer memory when loading Node.js program in time, by obtaining the script file analysis result of the JS program to be debugged loaded; Remove the script file analysis result obtained; When needs debugged program, again load JS program to be debugged; JS program to be debugged is debugged according to loading result again, reach after update routine without the need to restarting the object that process can carry out debugging, thus achieve the technique effect being convenient to system debug JS program, and then solve Node.js program cause due to amendment debug inconvenience technical matters.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, and form a application's part, schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the process flow diagram of the adjustment method of a kind of optional JS program according to the embodiment of the present invention; And
Fig. 2 is the schematic diagram of the debugging apparatus of a kind of optional JS program according to the embodiment of the present invention.
Embodiment
The present invention program is understood better in order to make those skilled in the art person, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a part of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, should belong to the scope of protection of the invention.
It should be noted that, term " first ", " second " etc. in instructions of the present invention and claims and above-mentioned accompanying drawing are for distinguishing similar object, and need not be used for describing specific order or precedence.Should be appreciated that the data used like this can be exchanged in the appropriate case, so as embodiments of the invention described herein can with except here diagram or describe those except order implement.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, such as, contain those steps or unit that the process of series of steps or unit, method, system, product or equipment is not necessarily limited to clearly list, but can comprise clearly do not list or for intrinsic other step of these processes, method, product or equipment or unit.
Embodiment 1
According to the embodiment of the present invention, provide a kind of embodiment of the method for adjustment method of JS program, it should be noted that, can perform in the computer system of such as one group of computer executable instructions in the step shown in the process flow diagram of accompanying drawing, and, although show logical order in flow charts, in some cases, can be different from the step shown or described by order execution herein.
Fig. 1 is the process flow diagram of the adjustment method of a kind of optional JS program according to the embodiment of the present invention, and as shown in Figure 1, the method comprises the steps:
Step S102, obtains the script file analysis result of the JS program to be debugged loaded;
Step S104, removes the script file analysis result obtained;
Step S106, when needs debugged program, loads JS program to be debugged again;
Step S108, debugs JS program to be debugged according to loading result again.
Wherein, JS program can be node.js program, and it can be server end, also can be browser section.The module loader code heat that node.js heat can be utilized to dispose upgrades, and also, the module loader utilizing node.js heat to dispose realizes when needs debugged program, again loads the operation of JS program to be debugged when current process is not restarted.The core that realizes of Node.js module management is Module._cache, as long as remove the buffer memory of this module, when upper once require, Node.js module management will reload up-to-date code.
Due to Node.js program be loaded quote time, system can program code read analyzing script file, simultaneously storing and resolving result.And use the present invention, Node.js program is quoted and after buffer memory script file analysis result in loading, by obtaining and removing the script file analysis result of the JS program to be debugged loaded, and when needs debugged program, again load the JS program that this is to be debugged, now, the meeting corresponding script file analysis result of buffer memory again, debugs JS program to be debugged according to the analysis result of buffer memory when again loading.Like this, can avoid restarting process, direct execution debugging operations, especially for the JS program be modified, invention achieves after update routine without the need to restarting the object that process can carry out debugging, thus achieve the technique effect being convenient to system debug JS program, and then solve Node.js program cause due to amendment debug inconvenience technical matters.
Alternatively, before the script file analysis result obtaining the JS program to be debugged loaded, said method can also comprise:
S2, whether the part or all of code detected in JS program to be debugged is modified;
S4, if be modified, then performs the step of the script file analysis result obtaining the JS program to be debugged loaded.If be not modified, then do not perform the step of the script file analysis result of the JS program to be debugged that acquisition has loaded.
Like this, only when JS program code changes, just remove the corresponding script file analysis result of buffer memory before JS program does not change, and when JS program code does not change, retain the corresponding script file analysis result of the JS program of institute's buffer memory, reach and prevent the unnecessary object repeating removing, caching, alleviate system burden.
Alternatively, whether the part or all of code detected in JS program to be debugged has been modified can comprise:
S6, whether the JS file that monitoring needs heat to upgrade is changed; And/or
S8, detects editing machine and whether has triggered the trigger mechanism removing script file analysis result when preserving file.
Wherein, the JS file needing heat to upgrade refers in Node.js program development process, needs the JS file upgraded when not restarting current process because some or all of code is modified.It should be noted that, can include but not limited to whether monitor the routing file needing heat to upgrade changes in the present invention.Editing machine can trigger the trigger mechanism removing script file analysis result function when preserving file can be realized by the expanded function of editing machine self.If JS file has been modified, then editing machine can preserve amended JS file, now, just can trigger the trigger mechanism removing the JS file script file analysis result of buffer memory before modification.
Whether the part or all of code detected in JS program to be debugged by above-mentioned any one or various ways is modified, and can reach complete detection accurately to determine the object whether JS program to be debugged is modified.
Alternatively, the means of editing machine trigger mechanism of triggering removing script file analysis result when preserving file can comprise:
S10, editing machine sends trigger pip when preserving file to the process that JS program to be debugged is corresponding; And/or
S12, the URL specified accessed by editing machine when preserving file.
It should be noted that, if all codes realizing the service described by JS file are all in same module, then cannot carry out heat for module and load.Realize heat to load, the foundation code needing some cannot carry out heat renewal controls more new technological process.Now, need some to isolate code cleverly the service code of frequent updating and the foundation code infrequently upgraded are kept apart.After being separated foundation code and service code, also need the trigger mechanism arranging renewal, at this, startup file is monitored as trigger mechanism, and file is monitored and included but are not limited to monitoring routing file, but will monitor all files needing heat to upgrade.Except this means monitored by file, in conjunction with the expanded function of editing machine, the mode such as trigger pip or an access specific URL can also be sent to Node.js process when preserving during JS file and carry out Trigger update JS file.
Alternatively, while removing the script file analysis result obtained, said method can also comprise:
S14, the adduction relationship of the script file that release obtains.Like this, adduction relationship can be discharged simultaneously and remove corresponding caching record, can remove completely unmodified before the object of Node.js program, really reach without the need to restarting the object that process can carry out debugging after update routine, thus achieve the technique effect being convenient to system debug JS program.
Alternatively, before the adduction relationship of the script file of release acquisition, said method can also comprise:
S16, whether detection adduction relationship comprises the adduction relationship except the adduction relationship of process corresponding to the JS program with to be debugged, wherein, if do not comprise, then performs the step of the adduction relationship of the script file that release obtains.
Further alternatively, after whether detection adduction relationship comprises the adduction relationship except the adduction relationship of process corresponding to the JS program with to be debugged, said method also comprises:
S18, if comprise, does not then perform the step of the adduction relationship of the script file that release obtains; Or
S20, if comprise, whether the dormancy time of the process of the adduction relationship except the adduction relationship of the process that then further to have detected identified corresponding except the JS program with to be debugged exceeds threshold value, if exceed threshold value, then perform the step of the adduction relationship of the script file that release obtains, if do not exceed threshold value, then do not perform the step of the adduction relationship of the script file that release obtains.
Like this, when the adduction relationship whether adduction relationship comprise except the adduction relationship of process corresponding to the JS program with to be debugged being detected, by performing above-mentioned steps, the maloperation of being removed in the lump by other adduction relationship when removing current adduction relationship can be avoided.
Embodiment 2
According to the embodiment of the present invention, provide a kind of device embodiment of debugging apparatus of JS program.
Fig. 2 is the schematic diagram of the debugging apparatus of a kind of optional JS program according to the embodiment of the present invention, and as shown in Figure 2, this device comprises: acquiring unit 202, clearing cell 204, loading unit 206 and debugging unit 208.Acquiring unit 202, for obtaining the script file analysis result of the JS program to be debugged loaded; Clearing cell 204, for removing the script file analysis result of acquisition; Loading unit 206, for when needs debugged program, loads JS program to be debugged again; Debugging unit 208, for debugging JS program to be debugged according to loading result again.
Wherein, JS program can be node.js program, and it can be server end, also can be browser section.The module loader code heat that node.js heat can be utilized to dispose upgrades, and also, the module loader utilizing node.js heat to dispose realizes when needs debugged program, again loads the operation of JS program to be debugged when current process is not restarted.The core that realizes of Node.js module management is Module._cache, as long as remove the buffer memory of this module, when upper once require, Node.js module management will reload up-to-date code.
Due to Node.js program be loaded quote time, system can program code read analyzing script file, simultaneously storing and resolving result.And use the present invention, Node.js program is quoted and after buffer memory script file analysis result in loading, by obtaining and removing the script file analysis result of the JS program to be debugged loaded, and when needs debugged program, again load the JS program that this is to be debugged, now, the meeting corresponding script file analysis result of buffer memory again, debugs JS program to be debugged according to the analysis result of buffer memory when again loading.Like this, can avoid restarting process, direct execution debugging operations, especially for the JS program be modified, invention achieves after update routine without the need to restarting the object that process can carry out debugging, thus achieve the technique effect being convenient to system debug JS program, and then solve Node.js program cause due to amendment debug inconvenience technical matters.
Alternatively, said apparatus can also comprise: the first detecting unit.First detecting unit, for before the script file analysis result obtaining the JS program to be debugged loaded, whether the part or all of code detected in JS program to be debugged is modified, when being modified, perform the function that acquiring unit obtains the script file analysis result of the JS program to be debugged loaded.
Like this, only when JS program code changes, just remove the corresponding script file analysis result of buffer memory before JS program does not change, and when JS program code does not change, retain the corresponding script file analysis result of the JS program of institute's buffer memory, reach and prevent the unnecessary object repeating removing, caching, alleviate system burden.
Whether alternatively, the first detecting unit comprises: monitor module, change for monitoring the JS file needing heat to upgrade; And/or detection module, whether trigger for detecting editing machine the trigger mechanism removing script file analysis result when preserving file.
Wherein, the JS file needing heat to upgrade refers in Node.js program development process, needs the JS file upgraded when not restarting current process because some or all of code is modified.It should be noted that, can include but not limited to whether monitor the routing file needing heat to upgrade changes in the present invention.Editing machine can trigger the trigger mechanism removing script file analysis result function when preserving file can be realized by the expanded function of editing machine self.If JS file has been modified, then editing machine can preserve amended JS file, now, just can trigger the trigger mechanism removing the JS file script file analysis result of buffer memory before modification.
Whether the part or all of code detected in JS program to be debugged by above-mentioned any one or various ways is modified, and can reach complete detection accurately to determine the object whether JS program to be debugged is modified.
Alternatively, said apparatus can also comprise trigger element, trigger element triggers the object of the trigger mechanism removing script file analysis result when preserving file for realizing editing machine, wherein, trigger element can comprise: send signal trigger module, sends trigger pip for editing machine when preserving file to the process that JS program to be debugged is corresponding; And/or access URL trigger module, access the URL specified when preserving file for editing machine.
It should be noted that, if all codes realizing the service described by JS file are all in same module, then cannot carry out heat for module and load.Realize heat to load, the foundation code needing some cannot carry out heat renewal controls more new technological process.Now, need some to isolate code cleverly the service code of frequent updating and the foundation code infrequently upgraded are kept apart.After being separated foundation code and service code, also need the trigger mechanism arranging renewal, at this, startup file is monitored as trigger mechanism, and file is monitored and included but are not limited to monitoring routing file, but will monitor all files needing heat to upgrade.Except this means monitored by file, in conjunction with the expanded function of editing machine, the mode such as trigger pip or an access specific URL can also be sent to Node.js process when preserving during JS file and carry out Trigger update JS file.
Alternatively, said apparatus can comprise: releasing unit, for while removing the script file analysis result obtained, and the adduction relationship of the script file that release obtains.
Like this, adduction relationship can be discharged simultaneously and remove corresponding caching record, can remove completely unmodified before the object of Node.js program, really reach without the need to restarting the object that process can carry out debugging after update routine, thus achieve the technique effect being convenient to system debug JS program.
Alternatively, said apparatus can comprise: the second detecting unit, for before the adduction relationship of the script file of release acquisition, whether detection adduction relationship comprises the adduction relationship except the adduction relationship of process corresponding to the JS program with to be debugged, wherein, when not comprising, perform the function of the adduction relationship of the script file that releasing unit release obtains.
Alternatively, said apparatus can comprise: after whether detection adduction relationship comprises the adduction relationship except the adduction relationship of process corresponding to the JS program with to be debugged, when comprising, do not perform the function of the adduction relationship of the script file that releasing unit release obtains; Or when comprising, second detecting unit, whether the dormancy time for the process of the adduction relationship except the adduction relationship of the process that to have detected identified further corresponding except the JS program with to be debugged exceeds threshold value, when exceeding threshold value, perform the step of the adduction relationship of the script file that releasing unit release obtains, when not exceeding threshold value, do not perform the step of the adduction relationship of the script file that releasing unit release obtains.
Like this, when the adduction relationship whether adduction relationship comprise except the adduction relationship of process corresponding to the JS program with to be debugged being detected, by performing above-mentioned steps, the maloperation of being removed in the lump by other adduction relationship when removing current adduction relationship can be avoided.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
In the above embodiment of the present invention, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
In several embodiments that the application provides, should be understood that, disclosed technology contents, the mode by other realizes.Wherein, device embodiment described above is only schematic, the division of such as unit, can be that a kind of logic function divides, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of unit or module or communication connection can be electrical or other form.
The unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed on multiple unit.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
If integrated unit using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprises all or part of step of some instructions in order to make a computer equipment (can be personal computer, server or the network equipment etc.) perform each embodiment method of the present invention.And aforesaid storage medium comprises: USB flash disk, ROM (read-only memory) (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), portable hard drive, magnetic disc or CD etc. various can be program code stored medium.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (14)

1. an adjustment method for JS program, is characterized in that, comprising:
Obtain the script file analysis result of the JS program to be debugged loaded;
Remove the described script file analysis result obtained;
When needs debugged program, again load described JS program to be debugged;
According to the described JS program to be debugged of the debugging of loading result again.
2. method according to claim 1, is characterized in that, before the script file analysis result obtaining the JS program to be debugged loaded, described method also comprises:
Whether the part or all of code detected in described JS program to be debugged is modified,
If be modified, then perform the step of the script file analysis result obtaining the JS program to be debugged loaded.
3. method according to claim 2, is characterized in that, whether the part or all of code detected in described JS program to be debugged has been modified comprises:
Whether the JS file that monitoring needs heat to upgrade is changed; And/or
Detect editing machine and whether trigger the trigger mechanism removing script file analysis result when preserving file.
4. method according to claim 3, is characterized in that, editing machine triggers the trigger mechanism removing script file analysis result means when preserving file comprise:
Editing machine sends trigger pip when preserving file to the process that described JS program to be debugged is corresponding; And/or
The URL specified accessed by editing machine when preserving file.
5. method according to claim 1, is characterized in that, while removing the described script file analysis result obtained, described method also comprises:
The adduction relationship of the described script file that release obtains.
6. method according to claim 5, is characterized in that, before the adduction relationship of the described script file of release acquisition, described method also comprises:
Detect described adduction relationship and whether comprise adduction relationship except the adduction relationship of the process corresponding with described JS program to be debugged, wherein,
If do not comprise, then perform the step of the adduction relationship of the described script file that release obtains.
7. method according to claim 6, is characterized in that, after whether the described adduction relationship of detection comprises the adduction relationship except the adduction relationship of the process corresponding with described JS program to be debugged, described method also comprises:
If comprise, then do not perform the step of the adduction relationship of the described script file that release obtains; Or
If comprise, whether the dormancy time of the process of the adduction relationship described in then having detected identified further except the adduction relationship of the process corresponding with described JS program to be debugged exceeds threshold value, if exceed threshold value, then perform the step of the adduction relationship of the described script file that release obtains, if do not exceed threshold value, then do not perform the step of the adduction relationship of the described script file that release obtains.
8. a debugging apparatus for JS program, is characterized in that, comprising:
Acquiring unit, for obtaining the script file analysis result of the JS program to be debugged loaded;
Clearing cell, for removing the described script file analysis result of acquisition;
Loading unit, for when needs debugged program, loads described JS program to be debugged again;
Debugging unit, for the basis described JS program to be debugged of loading result debugging again.
9. device according to claim 8, is characterized in that, described device also comprises:
First detecting unit, for before the script file analysis result obtaining the JS program to be debugged loaded, whether the part or all of code detected in described JS program to be debugged is modified,
When being modified, perform the function that described acquiring unit obtains the script file analysis result of the JS program to be debugged loaded.
10. device according to claim 9, is characterized in that, described first detecting unit comprises:
Monitoring module, whether changing for monitoring the JS file needing heat to upgrade; And/or
Whether detection module, triggered for detecting editing machine the trigger mechanism removing script file analysis result when preserving file.
11. devices according to claim 10, it is characterized in that, described device also comprises trigger element, and described trigger element triggers the object of the trigger mechanism removing script file analysis result when preserving file for realizing editing machine, wherein, described trigger element comprises:
Sending signal trigger module, sending trigger pip when preserving file to the process that described JS program to be debugged is corresponding for editing machine; And/or
Access URL trigger module, accesses the URL specified when preserving file for editing machine.
12. devices according to claim 8, is characterized in that, described device also comprises:
Releasing unit, for while removing the described script file analysis result obtained, the adduction relationship of the described script file that release obtains.
13. devices according to claim 12, is characterized in that, described device also comprises:
Second detecting unit, for before the adduction relationship of described script file that obtains in release, detects described adduction relationship and whether comprises adduction relationship except the adduction relationship of the process corresponding with described JS program to be debugged, wherein,
When not comprising, perform the function of the adduction relationship of the described script file that the release of described releasing unit obtains.
14. devices according to claim 13, is characterized in that, described device also comprises:
After whether the described adduction relationship of detection comprises the adduction relationship except the adduction relationship of the process corresponding with described JS program to be debugged, when comprising, do not perform the function of the adduction relationship of the described script file that the release of described releasing unit obtains; Or
When comprising, second detecting unit, whether the dormancy time for the process having detected described adduction relationship except the adduction relationship of the process corresponding with described JS program to be debugged further identified exceeds threshold value, when exceeding threshold value, perform the step of the adduction relationship of the described script file that the release of described releasing unit obtains, when not exceeding threshold value, do not perform the step of the adduction relationship of the described script file that the release of described releasing unit obtains.
CN201510461325.4A 2015-07-30 2015-07-30 The adjustment method and device of JS programs Active CN104991866B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510461325.4A CN104991866B (en) 2015-07-30 2015-07-30 The adjustment method and device of JS programs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510461325.4A CN104991866B (en) 2015-07-30 2015-07-30 The adjustment method and device of JS programs

Publications (2)

Publication Number Publication Date
CN104991866A true CN104991866A (en) 2015-10-21
CN104991866B CN104991866B (en) 2018-11-09

Family

ID=54303682

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510461325.4A Active CN104991866B (en) 2015-07-30 2015-07-30 The adjustment method and device of JS programs

Country Status (1)

Country Link
CN (1) CN104991866B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484823A (en) * 2016-09-28 2017-03-08 山东浪潮商用系统有限公司 A kind of amending method of CSS file, device and computer-readable medium
CN107229655A (en) * 2016-03-25 2017-10-03 北京京东尚科信息技术有限公司 The update method of page static file, apparatus and system
CN107918583A (en) * 2016-10-09 2018-04-17 腾讯科技(深圳)有限公司 A kind of script dynamic modulation, device and terminal
CN108536431A (en) * 2018-04-04 2018-09-14 浙江小泰科技有限公司 A kind of global command's row creates front end project approach and system
US20230080221A1 (en) * 2021-09-10 2023-03-16 Microsoft Technology Licensing, Llc Source code editing combining edit and continue with hot reload

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090217303A1 (en) * 2008-02-27 2009-08-27 Accenture Global Services Gmbh Test script transformation analyzer with change guide engine
CN101882105A (en) * 2010-06-01 2010-11-10 华南理工大学 Method for testing response time of Web page under concurrent environment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090217303A1 (en) * 2008-02-27 2009-08-27 Accenture Global Services Gmbh Test script transformation analyzer with change guide engine
CN101882105A (en) * 2010-06-01 2010-11-10 华南理工大学 Method for testing response time of Web page under concurrent environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
FANSHI: "Node.js Web应用代码热更新的另类思路", 《HTTP://FEX.BAIDU.COM/BLOG/2015/05/NODEJS-HOT-SWAPPING/》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107229655A (en) * 2016-03-25 2017-10-03 北京京东尚科信息技术有限公司 The update method of page static file, apparatus and system
CN106484823A (en) * 2016-09-28 2017-03-08 山东浪潮商用系统有限公司 A kind of amending method of CSS file, device and computer-readable medium
CN107918583A (en) * 2016-10-09 2018-04-17 腾讯科技(深圳)有限公司 A kind of script dynamic modulation, device and terminal
CN107918583B (en) * 2016-10-09 2021-01-19 腾讯科技(深圳)有限公司 Script dynamic debugging method, device and terminal
CN108536431A (en) * 2018-04-04 2018-09-14 浙江小泰科技有限公司 A kind of global command's row creates front end project approach and system
US20230080221A1 (en) * 2021-09-10 2023-03-16 Microsoft Technology Licensing, Llc Source code editing combining edit and continue with hot reload
US11847433B2 (en) * 2021-09-10 2023-12-19 Microsoft Technology Licensing, Llc Source code editing combining edit and continue with hot reload

Also Published As

Publication number Publication date
CN104991866B (en) 2018-11-09

Similar Documents

Publication Publication Date Title
KR101835303B1 (en) Systems and methods for collecting, tracking, and storing system performance and event data for computing devices
CN105204979A (en) Recording method of Android logs and mobile terminal
CN104991866A (en) Debugging method and device of JS program
US20170147469A1 (en) Correlation of source code with system dump information
US20150089479A1 (en) Method for pre-testing software compatibility and system thereof
US10324784B2 (en) Mitigating crashes of an application server executing a monitoring agent
US9928055B1 (en) Validating development software by comparing results from processing historic data sets
CN105095059A (en) Method and device for automated testing
US20130111018A1 (en) Passive monitoring of virtual systems using agent-less, offline indexing
WO2011119455A1 (en) Methods and apparatus for debugging programs in shared memory
EP3552107B1 (en) Device driver telemetry
CN104426945B (en) A kind of method, apparatus and system obtaining application performance data
CN104410671A (en) Snapshot capturing method and data monitoring tool
EP4102782A1 (en) Communication device, surveillance server, and log collection method
CN105260290A (en) Application exception information collection method and apparatus
CN103810086A (en) Method, device and system for processing website causing browser breakdown
CN112346989A (en) Interface testing method, device, medium and computing equipment
CN112417050A (en) Data synchronization method and device, system, storage medium and electronic device
WO2016153377A1 (en) Smart logging of trace data for storage systems
KR20150110542A (en) Digital memory imaging system and method
CN111177716B (en) Method, device, equipment and storage medium for acquiring executable file in memory
CN112416385A (en) Acquisition component management method and system
CN107239377A (en) The method and apparatus for obtaining Java Virtual Machine running status
CN116149941A (en) Monitoring method and device of server component, server and storage medium
CN115048272A (en) Container monitoring processing method, device, host, system, storage medium and program product

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100094 Beijing city Haidian District Taiping Road 18 city building C 301

Applicant after: DATANG NETWORK CO.,LTD.

Address before: 100094 Beijing Haidian District Yongjia North Road 6, 5 2 story 218 room.

Applicant before: BEIJING XINHUA RUIDE TECHNOLOGY CO.,LTD.

GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100094 Beijing city Haidian District Taiping Road 18 city building C 301

Patentee after: Guoxing Network Co.,Ltd.

Address before: 100094 Beijing city Haidian District Taiping Road 18 city building C 301

Patentee before: DATANG NETWORK CO.,LTD.