Microsoft MVP성태의 닷넷 이야기
COM : 3. ActiveScript의 문법 오류 검사 [링크 복사], [링크+제목 복사]
조회: 5903
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

Checking For Script Syntax Errors
; https://learn.microsoft.com/en-us/archive/blogs/ericlippert/checking-for-script-syntax-errors-this-time-with-code

가장 좋은 방법은 스크립트 전용 문법 검사기를 제공하는 3rd-party 제품을 이용하는 것이겠지만.

ParseScriptText를 이용해서도 맨 처음에 발생하는 문법 오류는 확인할 수 있습니다.
"맨 처음"이라는 제한을 없애기 위해서, 위의 댓글에 보면 문법 체크를 위한 별도의 jscript를 소개하고 있습니다. 좋아보이기는 한데... 한 가지 단점이 있습니다.
문법을 검사할 단위를 잘 쪼개서 eval에 넘겨야 하는데... 꼭 라인 하나당 적법한 문법이 오는 것이 아니니 별로 효용성은 없을 것 같은 생각이 듭니다. 단지, 그 정도의 기능이라면 전체 스크립트 문법을 검사하는 파서를 만드는 것보다는 "적법한 문법" 단위로 자르는 파서가 좀 더 쉽게 만들 수 있다는 정도겠지요.


[연관 글]






[최초 등록일: ]
[최종 수정일: 2/5/2023]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-동일조건변경허락 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.

비밀번호

댓글 작성자
 



2014-10-02 01시53분
정성태
2016-08-22 05시53분
정성태
2022-05-23 10시26분
Running JavaScript inside a .NET app with JavaScriptEngineSwitcher
;https://andrewlock.net/running-javascript-in-a-dotnet-app-with-javascriptengineswitcher/

microsoft/ClearScript
; https://github.com/Microsoft/ClearScript

A library for adding scripting to .NET applications. Supports V8 (Windows, Linux, macOS) and JScript/VBScript (Windows).

JavascriptNet/Javascript.Net
https://github.com/JavascriptNet/Javascript.Net
.Net bindings to the V8 JavaScript engine

A .NET library to parse and execute JavaScript code.
paulbartrum/jurassic
; https://github.com/paulbartrum/jurassic

Taritsyn/MsieJavaScriptEngine
; https://github.com/Taritsyn/MsieJavaScriptEngine

.NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). Project was based on the code of SassAndCoffee.JavaScript and Chakra Sample Hosts.
정성태

1  2  3  4  5  6  7  [8] 
NoWriterDateCnt.TitleFile(s)
18정성태7/17/20034007RegistryEx 클래스 (VC++6.0, Win32) 2000.02.28파일 다운로드1
17정성태9/22/20054869Crypto 클래스 (VC++6.0, Win32) [1]파일 다운로드1
16정성태7/17/20034426Win32 Control Spy (Win32)파일 다운로드1
15정성태7/17/20035106RichEdit Control 클래스 (VC ++ 6.0)파일 다운로드1
1  2  3  4  5  6  7  [8]