馃 绉诲姩绔?JS 寮曟搸鍝寮猴紵缇庡浗纭呰胺鎵?.....
Posted 鍗や唬鐑?,
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了馃 绉诲姩绔?JS 寮曟搸鍝寮猴紵缇庡浗纭呰胺鎵?.....相关的知识,希望对你有一定的参考价值。
濡傛灉浣犲枩娆㈡垜鐨勬枃绔狅紝甯屾湜鐐硅禐馃憤 鏀惰棌 馃搧 璇勮 馃挰 涓夎繛涓€涓嬶紝璋㈣阿浣狅紝杩欏鎴戠湡鐨勫緢閲嶈锛?/blockquote>鍦ㄤ竴鑸殑绉诲姩绔紑鍙戝満鏅腑锛屾瘡娆℃洿鏂板簲鐢ㄥ姛鑳介兘鏄€氳繃 Native 璇█寮€鍙戝苟閫氳繃搴旂敤甯傚満鐗堟湰鍒嗗彂鏉ュ疄鐜扮殑銆備絾鏄競鍦虹灛鎭竾鍙橈紝Native 璇█鍦ㄥ紑鍙戞晥鐜囦笂瀛樺湪涓€瀹氫笉瓒筹紝骞朵笖浠?
APP 鐗堟湰鏇存柊
鍒?搴旂敤甯傚満瀹℃牳鍙戝竷
鍐嶅埌鐢ㄦ埛涓嬭浇鏇存柊
锛屾€讳細瀛樺湪涓€瀹氱殑鏃堕棿宸紝杩欐牱灏卞鑷存柊鐨勫姛鑳芥棤娉曞強鏃惰鐩栧叏閲忕敤鎴枫€?/p>涓轰簡瑙e喅杩欎釜闂锛屽紑鍙戣€呬滑涓€鑸細鍦ㄩ」鐩噷寮曞叆涓€闂?strong>鑴氭湰璇█锛屾彁閫?APP 鐨勭爺鍙戞祦绋嬨€傚湪绉诲姩绔簲鐢ㄦ瘮杈冨箍娉涚殑鑴氭湰璇█鏈?Lua 鍜?JavaScript锛屽墠鑰呭湪娓告垙棰嗗煙鐢ㄧ殑姣旇緝澶氾紝鍚庤€呭湪搴旂敤棰嗗煙鐢ㄧ殑姣旇緝澶氥€傛湰绡囨枃绔犱富瑕佹槸鎯虫帰璁ㄤ竴涓嬬Щ鍔ㄥ弻绔紙iOS & Android锛夌殑 JavaScript 寮曟搸閫夊瀷銆傜敱浜庝釜浜烘按骞虫湁闄愶紝鏂囩珷鎬讳細鏈夐仐婕忓拰涓嶈冻鐨勫湴鏂癸紝杩樿鍚勪綅澶т浆澶氬鎸囨暀銆?/p>
<!--truncate-->
JS 寮曟搸閫夊瀷瑕佺偣
JavaScript 浣滀负涓栫晫涓婃渶鐑棬鐨勮剼鏈瑷€锛屾湁鐫€闈炲父澶氱殑寮曟搸瀹炵幇锛氭湁 Apple 寰$敤鐨?JavaScriptCore锛屾湁鎬ц兘鏈€寮哄姴鐨?V8锛岃繕鏈夋渶杩戠儹搴﹀緢楂樼殑 QuickJS......濡備綍浠庤繖浜?JS 寮曟搸閲岄€夊嚭鏈€閫傚悎鐨勶紵鎴戜釜浜鸿涓鸿鏈夊嚑涓€冮噺锛?/p>
- 鎬ц兘锛氳繖涓病璇濊锛岃偗瀹氭槸瓒婂揩瓒婂ソ
- 浣撶Н锛欽S 寮曟搸浼氬鍔犱竴瀹氱殑鍖呬綋绉?/li>
- 鍐呭瓨鍗犵敤锛氬唴瀛樺崰鐢ㄨ秺灏戣秺濂?/li>
- JavaScript 璇硶鏀寔绋嬪害锛氭敮鎸佺殑鏂拌娉曡秺澶氳秺濂?/li>
- 璋冭瘯鐨勪究鎹锋€?/strong>锛氭槸鍚︾洿鎺ユ敮鎸?debug锛熻繕鏄渶瑕佽嚜宸辩紪璇戝疄鐜拌皟璇曞伐鍏烽摼
- 搴旂敤甯傚満骞冲彴瑙勮寖锛氫富瑕佹槸 ios 骞冲彴锛屽钩鍙扮姝㈠簲鐢ㄩ泦鎴愬甫 JIT 鍔熻兘鐨勮櫄鎷熸満
姣旇緝楹荤儲鐨勬槸锛屼笂闈㈢殑鍑犱釜鐐归兘涓嶆槸浜掔浉鐙珛鐨勶紝姣斿璇村紑鍚?JIT 鐨?V8 寮曟搸锛屾€ц兘鑲畾鏄渶濂界殑锛屼絾瀹冨紩鎿庝綋绉氨寰堝ぇ锛屽唴瀛樺崰鐢ㄤ篃寰堥珮锛涘湪鍖呬綋绉笂寰堝崰浼樺娍鐨?QuickJS锛岀敱浜庢病鏈?JIT 鍔犳寔锛屽拰鏈?JIT 鐨勫紩鎿庢瘮璧锋潵骞冲潎浼氭湁 5-10 鍊嶇殑鎬ц兘宸窛銆?/p>
涓嬮潰鎴戜細缁煎悎鍒氬垰鎻愬埌鐨勫嚑涓偣锛屽苟閫夋嫨浜?JavaScriptCore锛?strong>V8锛?strong>Hermes 鍜?QuickJS 杩?4 涓?JSVM锛岃璇村畠浠殑浼樼偣鍜岀壒鐐癸紝鍐嶈皥璋堜粬浠殑涓嶈冻銆?/p>
JS 寮曟搸鍔熻兘澶ф瘮鎷?/h2>
1.javascriptCore
JavaScriptCore 鏄?WebKit 榛樿鐨勫唴宓?JS 寮曟搸锛寃ikipedia 涓婇兘娌℃湁鐙珛鐨勮瘝鏉★紝鍙湪 WebKit 璇嶆潯鐨?a href="https://link.segmentfault.com/?url=https%3A%2F%2Fwww.wikiwand.com%2Fen%2FWebKit%23%2FJavaScriptCore" rel="nofollow">涓夌骇鐩綍閲屼粙缁嶄簡涓€涓嬶紝涓汉鎰熻杩樻槸鏈変簺涓嶅儚璇濓紝姣曠珶涔熸槸鑰佺墝 JS 寮曟搸浜嗐€?/p>
鐢变簬 WebKit 鏄?Apple 鐜囧厛寮€婧愮殑锛屾墍浠?WebKit 寮曟搸杩愮敤鍦?Apple 鑷鐨?Safari 娴忚鍣ㄥ拰 WebView 涓婏紝灏ゅ叾鏄?iOS 绯荤粺涓婏紝鍥犱负 Apple 鐨勯檺鍒讹紝鎵€鏈夌殑缃戦〉鍙兘鐢?WebKit 鍔犺浇锛屾墍浠?WebKit 鍦?iOS 涓婅揪鍒颁簡浜嬪疄鍨勬柇锛屼綔涓?WebKit 妯″潡涓€閮ㄥ垎鐨?JSC锛岄『鐫€鏀跨瓥鏄ラ锛屼篃銆屽熀鏈€嶅瀯鏂簡 iOS 骞冲彴鐨?JS 寮曟搸浠介銆?/p>
鍨勬柇褰掑瀯鏂紝鍏跺疄 JSC 鐨?strong>鎬ц兘杩樻槸鍙互鐨?/strong>锛屽緢澶氫汉涓嶇煡閬?JSC 鐨?JIT 鍔熻兘鍏跺疄姣?V8 杩樿鏃╋紝鏀惧湪鍗佸嚑骞村墠鏄渶濂界殑 JS 寮曟搸锛屽彧涓嶈繃鍚庢潵琚?V8 杩戒簡涓婃潵銆傝€屼笖 JSC 鏈変釜閲嶅ぇ鍒╁ソ锛屽湪 iOS7 涔嬪悗锛孞SC 浣滀负涓€涓郴缁熺骇鐨?Framework 寮€鏀剧粰寮€鍙戣€呬娇鐢紝涔熷氨鏄锛屽鏋滀綘鐨?APP 浣跨敤 JSC锛屽彧闇€瑕佸湪椤圭洰閲?
import
涓€涓嬶紝鍖呬綋绉槸 0 寮€閿€鐨?/strong>锛佽繖鐐瑰湪浠婂ぉ璁ㄨ鐨?JS 寮曟搸涓紝JSC 鏄渶鑳芥墦鐨勩€?/p>
铏界劧寮€鍚?JIT 鐨?JSC 鎬ц兘寰堝ソ锛屼絾鏄彧闄愪簬鑻规灉寰$敤鐨?Safari 娴忚鍣ㄥ拰 WKWebView锛屽彧鏈夎繖涓や釜鍦版柟 JIT 鍔熻兘鎵嶆槸榛樿寮€鍚殑锛屽鏋滃湪椤圭洰閲岀洿鎺ュ紩鍏?JSC锛孞IT 鍔熻兘鏄叧闂殑銆備负浠€涔堣繖涔堝仛鍛紵RednaxelaFX 澶т浆 缁欏嚭杩囬潪甯镐笓涓氱殑瑙i噴锛?/p>
JIT 缂栬瘧闇€瑕佸簳灞傜郴缁熸敮鎸佸姩鎬佷唬鐮佺敓鎴愶紝瀵规搷浣滅郴缁熸潵璇磋繖鎰忓懗鐫€瑕佹敮鎸佸姩鎬佸垎閰嶅甫鏈夆€滃彲鍐欏彲鎵ц鈥濇潈闄愮殑鍐呭瓨椤点€傚綋涓€涓簲鐢ㄧ▼搴忔嫢鏈夎姹傚垎閰嶅彲鍐欏彲鎵ц鍐呭瓨椤电殑鏉冮檺鏃讹紝瀹冧細姣旇緝瀹规槗鍙楀埌鏀诲嚮浠庤€屽厑璁镐换鎰忎唬鐮佸姩鎬佺敓鎴愬苟鎵ц锛岃繖鏍峰氨璁╂伓鎰忎唬鐮佹洿瀹规槗鏈夋満鍙箻銆?/blockquote>Apple 鍑轰簬瀹夊叏涓婄殑鑰冭檻锛岀姝簡绗笁鏂?APP 浣跨敤 JSC 鏃跺紑鍚?JIT锛岃繖浜涚壒鐐瑰湪 React Native 鐨?JS Runtime 椤甸潰涔熸湁杩囩浉鍏崇殑瑙i噴銆備笉杩囧湪瀹為檯搴旂敤涓紝涓嶅仛閲?CPU 鐨勮繍绠楀彧褰撹兌姘磋瑷€浣跨敤锛孞SC 杩樻槸缁扮话鏈変綑浜嗐€?/p>
涓婇潰鐨勮璁洪兘鏄拡瀵?iOS 绯荤粺鐨勶紝鍦?Android 绯荤粺涓婏紝JSC 鐨勮〃鐜板氨涓嶅敖浜烘剰浜嗐€侸SC 骞舵病鏈夊 Android 鏈哄瀷鍋氬緢濂界殑閫傞厤锛岃櫧鐒跺彲浠ュ紑鍚?JIT锛屼絾鏄€ц兘琛ㄧ幇骞朵笉濂斤紝杩欎篃鏄?Facebook 鍐冲績鍒朵綔 Hermes 鐨勪竴涓師鍥狅紝鍏蜂綋鐨勬€ц兘瀵规瘮鍒嗘瀽鍙鏈枃鐨?Hermes 灏忚妭銆?/p>
鏈€鍚庡啀璇磋 JSC 鐨?strong>璋冭瘯鏀寔鎯呭喌銆傚鏋滄槸 iOS 骞冲彴锛屾垜浠彲浠ョ洿鎺ョ敤 Safari 鐨?
debbuger
鍔熻兘璋冭瘯锛屽鏋滄槸 Android 骞冲彴锛岀洰鍓嶆垜杩樻病鏈夋壘鍒颁竴涓緢濂界殑鐪熸満璋冭瘯鏂规硶銆?/p>
缁煎悎鏉ョ湅锛孞avaScriptCore 鍦?iOS 骞冲彴涓婃湁闈炲父鏄庢樉鐨勪富鍦轰紭鍔匡紝鍚勪釜鎸囨爣閮芥槸寰堜紭绉€鐨勶紝浣嗗湪 Android 涓婂洜涓虹己涔忎紭鍖栵紝琛ㄧ幇骞朵笉鏄緢濂姐€?/strong>
2.V8
V8锛屾垜鎯虫垜涓嶇敤杩囧瑙i噴浜嗭紝JavaScript 鑳芥湁濡備粖鐨勫湴浣嶏紝V8 鍔熶笉鍙病銆傛€ц兘娌″緱璇达紝寮€鍚?JIT 鍚庡氨鏄笟鍐呮渶寮猴紙涓嶆鏄?JS锛夛紝鏈夊緢澶氫粙缁?V8 鐨勬枃绔狅紝鎴戣繖閲屽氨涓嶅鎻忚堪浜嗭紝鎴戜滑杩欓噷璇磋 V8 鍦ㄧЩ鍔ㄧ鐨勮〃鐜般€?/p>
鍚屾牱浣滀负 Google 瀹剁殑浜у搧锛屾瘡涓€鍙?Android 鎵嬫満涓婇兘瀹夎浜嗗熀浜?Chromium 鐨?WebView锛孷8 涔熶竴骞舵崋缁戜簡銆備絾鏄?V8 鍜?Chromium 鎹嗙粦鐨勫お绱у瘑浜嗭紝涓嶅儚 iOS 涓婄殑 JavaScriptCore 灏佽涓虹郴缁熷簱鍙互琚墍鏈?App 璋冪敤銆傝繖灏卞鑷翠綘鎯冲湪 Android 涓婄敤 V8 杩樺緱鑷繁灏佽锛岀ぞ鍖烘瘮杈冨嚭鍚嶇殑椤圭洰鏄?J2V8锛屾彁渚涗簡 V8 鐨?Java bindings 妗堜緥銆?/p>
V8 鎬ц兘娌″緱璇?/strong>锛孉ndroid 涓婂彲浠ュ紑鍚?JIT锛屼絾杩欎簺浼樺娍閮芥槸鏈変唬浠风殑锛氬紑鍚?JIT 鍚?strong>鍐呭瓨鍗犵敤楂?/strong>锛屽苟涓?V8 鐨?strong>鍖呬綋绉篃涓嶅皬锛堝ぇ姒?
7 MB
宸﹀彸锛夛紝濡傛灉浣滀负鍙槸鐢?UI 鐨?Hybrid 绯荤粺锛岃繕鏄湁浜涘ア渚堜簡銆?/p>鎴戜滑鍐嶈璇?V8 鍦?iOS 涓婄殑闆嗘垚銆俈8 鍦?2019 骞存帹鍑轰簡 JIT-less V8锛屼篃灏辨槸鍏抽棴 JIT 鍙娇鐢?
Ignition interpreter
瑙i噴鎵ц JS 鏂囦欢锛岄偅涔堟垜浠湪 iOS 涓婇泦鎴?V8 灏辨垚浜嗗彲鑳斤紝鍥犱负 Apple 杩樻槸鏀寔鎺ュ叆鍙湁瑙i噴鍣ㄥ姛鑳界殑铏氭嫙鏈哄紩鎿庣殑銆備絾鏄釜浜鸿涓哄叧闂簡 JIT 鐨?V8 鎺ュ叆 iOS 浠峰€间笉澶э紝鍥犱负鍙紑鍚В閲婂櫒鐨勮瘽锛岃繖鏃跺€欑殑 V8 鍜?JSC 鐨勬€ц兘鍏跺疄鏄樊涓嶅鐨勶紝寮曞叆鍙嶈€屼細澧炲姞涓€瀹氱殑浣撶Н寮€閿€銆?/p>
V8 杩樻湁涓€涓湁鎰忔€濈殑鐗规€у緢灏戜汉鎻愬強锛岄偅灏辨槸鈥斺€?strong>鍫嗗揩鐓э紙Heap snapshots锛?/strong>锛岃繖涓槸 V8 鍦?2015 骞村氨鏀寔鐨勫姛鑳斤紝浣嗘槸绀惧尯閲屽緢灏戞湁浜鸿璁哄畠銆?/p>
鍫嗗揩鐓ф槸浠€涔堝師鐞嗗憿锛熶竴鑸潵璇?JSVM 鍚姩鍚庯紝绗竴姝ュ線寰€鏄В鏋?JS 鏂囦欢锛岃繖涓繕鏄瘮杈冭€楁椂鐨勶紝V8 鏀寔棰勫厛鐢熸垚 Heap snapshots锛岀劧鍚庣洿鎺ュ姞杞藉埌鍫嗗唴瀛樹腑锛屽揩閫熺殑鑾峰緱 JS 鐨勫垵濮嬪寲涓婁笅鏂囥€傝法骞冲彴妗嗘灦 NativeScript 灏卞埄鐢ㄤ簡杩欐牱鐨勬妧鏈紝鍙互璁?JS 鐨勫姞杞介€熷害鎻愬崌 3 鍊嶏紝鎶€鏈粏鑺傚彲浠ョ湅浠栦滑鐨?a href="https://link.segmentfault.com/?url=https%3A%2F%2Fnativescript.org%2Fblog%2Fimproving-app-startup-time-on-android-with-webpack-v8-heap-snapshot%2F" rel="nofollow">鍗氭枃銆?/p>
V8 鐪熸満璋冭瘯涔熼渶瑕佸紩鍏ョ涓夋柟搴擄紝Android 绔ぞ鍖轰笂鏈変汉瀵?J2V8 鍋氫簡 Chrome 璋冭瘯鍗忚鐨勬墿灞曪紝鍗? J2V8-Debugger 椤圭洰锛宨OS 鎴戞病鏈夋壘鍒扮浉鍏崇殑椤圭洰锛屽彲鑳介渶瑕佽嚜宸卞疄鐜颁竴濂楁墿灞曘€?/p>
缁煎悎鏉ョ湅 V8 鐨勭‘鏄?JSVM 涓殑鎬ц兘鐜嬭€咃紝Android 绔娇鐢ㄦ椂鍙互瀹屽叏鍙戞尌瀹冪殑濞佸姏锛屼絾鏄?iOS 骞冲彴鍥犱负涓诲満鍔e娍锛屽苟涓嶆槸寰堟帹鑽愩€?/strong>
3.Hermes
Hermes 鏄?FaceBook 2019 骞翠腑鏃紑婧愮殑涓€娆?JS 寮曟搸锛屼粠 release 璁板綍鍙互鐪嬪嚭锛岃繖涓槸涓撲负 React Native 鎵撻€犵殑 JS 寮曟搸锛屽彲浠ヨ浠庤璁′箣鍒濆氨鏄负 Hybrid UI 绯荤粺鎵撻€犮€?/p>
Hermes 涓€寮€濮嬫帹鍑哄氨鏄鏇夸唬鍘熸潵 RN Android 绔殑 JS 寮曟搸锛屽嵆 JavaScriptCore锛堝洜涓?JSC 鍦?Android 绔〃鐜板お鎷夊灝浜嗭級銆傛垜浠彲浠ョ悊涓€涓嬫椂闂寸嚎锛孎aceBook 鑷粠 2019-07-12 瀹e竷 Hermes 寮€婧?/a>鍚庯紝jsc-android 鐨勭淮鎶や俊鎭氨姘歌繙鐨勫仠鍦ㄤ簡 2019-06-25锛岃繖涓俊鍙锋殫绀哄緱闈炲父鐨勬槑鏄撅細JavaScriptCore Android 鎴戜滑涓嶅啀缁存姢鍟︼紝澶у閮藉幓鐢ㄦ垜浠仛鐨?Hermes 鍟?/strong>銆?/p>
鏈€杩?Hermes 宸茬粡璁″垝浼撮殢 React Native 0.64 鐗堟湰鐧诲綍 iOS 骞冲彴浜嗭紝浣嗘槸 RN 鐗堟湰鏇存柊 blog 杩樻病鏈夊嚭锛屽ぇ瀹跺彲浠ョ湅鐪嬫垜涔嬪墠瀵?Apple 寮€鍙戣€呭崗璁殑瑙h锛?a href="https://link.segmentfault.com/?url=https%3A%2F%2Fsupercodepower.com%2Fhow-to-hide-bundle%23%25E4%25BA%258C%25E3%2580%2581%25E8%25A7%25A3%25E8%25AF%25BB%25E8%25A7%2584%25E8%258C%2583" rel="nofollow">Apple Agreement 3.3.2 瑙勮寖瑙h锛屽湪杩欓噷鎴戝氨涓嶅璇翠簡銆?/p>
Hermes 鐨勭壒鐐逛富瑕佹槸涓や釜锛屼竴涓槸涓嶆敮鎸?JIT锛屼竴涓槸鏀寔鐩存帴鐢熸垚/鍔犺浇瀛楄妭鐮?/strong>锛屾垜浠湪涓嬮潰鍒嗗紑璁蹭竴涓嬨€?/p>
Hermes 涓嶆敮鎸?JIT 鐨勪富瑕佸師鍥犳湁涓や釜锛氬姞鍏?JIT 鍚庯紝JS 寮曟搸鍚姩鐨勯鐑椂闂翠細鍙橀暱锛屼竴瀹氱▼搴︿笂浼氬姞闀块灞?TTI锛堥〉闈㈤娆″姞杞藉彲浜や簰鏃堕棿锛夛紝鐜板湪鐨勫墠绔〉闈㈤兘璁茬┒涓€涓寮€锛孴TI 杩樻槸涓尯閲嶈鐨勬祴閲忔寚鏍囥€傚彟涓€涓棶棰樹笂 JIT 浼氬鍔犲寘浣撶Н鍜屽唴瀛樺崰鐢紝Chrome 鍐呭瓨鍗犵敤楂?V8 杩樻槸瑕佹壙鎷呬竴瀹氳矗浠荤殑銆?/p>
鍥犱负涓嶆敮鎸?JIT锛孒ermes 鍦ㄤ竴浜?CPU 瀵嗛泦璁$畻鐨勯鍩熷氨涓嶅崰浼樺娍浜嗭紝鎵€浠ュ湪 Hybrid 绯荤粺閲岋紝鏈€浼樼殑瑙e喅鏂规灏辨槸鍏呭垎鍙戞尌 JavaScript 鑳舵按璇█鐨勪綔鐢紝CPU 瀵嗛泦鐨勮绠楋紙渚嬪鐭╅樀鍙樻崲锛屽弬鏁板姞瀵嗙瓑锛夋斁鍦?Native 閲屽仛锛岀畻濂戒簡鍐嶄紶閫掔粰 JS 琛ㄧ幇鍦?UI 涓婏紝杩欐牱鍙互鍏奸【鎬ц兘鍜屽紑鍙戞晥鐜囥€?/p>
Hermes 鏈€寮曚汉鐬╃洰鐨勫氨鏄敮鎸佺敓鎴愬瓧鑺傜爜浜嗭紝鎴戝湪涔嬪墠鐨勫崥鏂?a href="https://link.segmentfault.com/?url=https%3A%2F%2Fsupercodepower.com%2Fcross-platform-tech%234react-native%25EF%25BC%259Ajs-engine--native-renderpipeline" rel="nofollow">銆婐煄?璺ㄧ妗嗘灦鐨勬牳蹇冩妧鏈埌搴曟槸浠€涔堬紵銆?/a>涔熸彁鍒拌繃锛孒ermes 鍔犲叆 AOT 鍚庯紝
Babel
銆?code>Minify銆?code>Parse 鍜?Compile
杩欎簺娴佺▼鍏ㄩ儴閮藉湪寮€鍙戣€呯數鑴戜笂瀹屾垚锛岀洿鎺ヤ笅鍙戝瓧鑺傜爜璁?Hermes 杩愯灏辫锛屾垜浠洿鎺ョ敤涓?demo 婕旂ず涓€涓嬨€?/p>鍏堝啓涓?
test.js
鐨勬枃浠讹紝閲岄潰闅忎究鍐欑偣鍟ラ兘琛岋紱鐒跺悗缂栬瘧涓€涓?Hermes 鐨勬簮鐮侊紝缂栬瘧杩囩▼鐩存帴鎸?a href="https://link.segmentfault.com/?url=https%3A%2F%2Fgithub.com%2Ffacebook%2Fhermes%2Fblob%2Fmaster%2Fdoc%2FBuildingAndRunning.md" rel="nofollow">鏂囨。鏉ュ氨琛岋紝鎴戣繖閲屽氨鐣ヨ繃浜嗐€?/p>棣栧厛 Hermes 鏀寔鐩存帴瑙i噴杩愯 JS 浠g爜锛屽氨鏄甯哥殑 JS 鍔犺浇缂栬瘧杩愯娴佺▼銆?/p>
hermes test.js
鎴戜滑鍙互鍔犲叆
-emit-binary
鍙傛暟灏濊瘯涓€涓嬬敓鎴?Bytecode 鐨勫姛鑳斤細hermes -emit-binary -out test.hbc test.js
鐒跺悗灏变細鐢熸垚涓€浠?
test.hbc
瀛楄妭鐮佹枃浠讹細鏈€鍚庢垜浠彲浠ヨ Hermes 鐩存帴鍔犺浇杩愯
test.hbc
鏂囦欢锛?/p>hermes test.hbc
瀹㈣璇勪环涓€涓?Hermes 鐨勫瓧鑺傜爜锛岄鍏堢渷鍘讳簡鍦?JS 寮曟搸閲岃В鏋愮紪璇戠殑娴佺▼锛孞S 浠g爜鐨勫姞杞介€熷害灏嗕細澶уぇ鍔犲揩锛屼綋鐜板湪 UI 涓婂氨鏄?TTI 鏃堕棿浼氭槑鏄剧缉鐭紱鍙︿竴涓紭鍔?Hermes 鐨勫瓧鑺傜爜鍦ㄨ璁℃椂灏辫€冭檻浜嗙Щ鍔ㄧ鐨勬€ц兘闄愬埗锛屾敮鎸佸閲忓姞杞借€屼笉鏄叏閲忓姞杞斤紝瀵瑰唴瀛樺彈闄愮殑涓綆绔?Android 鏈烘洿鍙嬪ソ锛涗笉杩囧瓧鑺傜爜鐨勪綋绉細姣斿師鏉ョ殑 JS 鏂囦欢浼氬ぇ涓€浜涳紝浣嗘槸鑰冭檻鍒?Hermes 寮曟搸鏈韩浣撶Н灏变笉澶э紝缁煎悎鑰冭檻涓嬫潵杩欎簺浣撶Н澧為噺杩樻槸鍙互鎺ュ彈鐨勩€?/p>
鍏充簬璇︾粏鐨?Hermes 鎬ц兘娴嬭瘯鎯呭喌锛岀綉涓婃湁涓ょ瘒鏂囩珷鍐欑殑姣旇緝濂斤細涓€绡囨槸 React Native Memory profiling: JSC vs V8 vs Hermes锛屽彲浠ョ湅鍒板湪 android 璁惧涓?Hermes 鐨勮〃鐜拌繕鏄緢浼樺紓鐨勶紝鑰?JSC 鐨勮〃鐜伴潪甯告媺鍨細
鍙︿竴绡囨槸鎼虹▼鐨勬枃绔狅細鎼虹▼瀵?RN 鏂颁竴浠?JS 寮曟搸 Hermes 鐨勮皟鐮?/a>锛屽彲浠ョ湅鍑?Hermes 缁煎悎鎴愮哗鏈€楂橈紙JSC 杩樻槸涓€鏍风殑鎷夊灝锛夛細
璇村畬鎬ц兘鎴戜滑鍐嶈璇?Hermes 鐨?JS 璇硶鏀寔鎯呭喌銆侶ermes 涓昏鏀寔鐨勬槸 ES6 璇硶锛屽垰寮€婧愭椂涓嶆敮鎸?
Proxy
锛屼笉杩?v0.7.0 宸茬粡鏀寔浜嗐€備粬浠殑鍥㈤槦涔熸瘮杈冩湁鎯虫硶锛屼笉鏀寔with
eval()
绛夎繖绉嶅睘浜庤璁$碂绮曠殑 API锛岃繖绉嶈璁$殑鏉冭 鎴戜釜浜鸿繕鏄瘮杈冭鍚岀殑銆?/p>
鏈€鍚庢垜浠皥璋?Hermes 鐨?strong>璋冭瘯鍔熻兘銆傜洰鍓?Hermes 宸茬粡鏀寔浜?Chrome 鐨勮皟璇曞崗璁紝鎴戜滑鍙互鐩存帴鐢?Chrome 鐨?debugging 宸ュ叿鐩存帴璋冭瘯 Hermes 寮曟搸锛屽叿浣撶殑鎿嶄綔鍙鏂囨。锛?a href="https://link.segmentfault.com/?url=https%3A%2F%2Freactnative.dev%2Fdocs%2Fhermes%23debugging-js-on-hermes-using-google-chromes-devtools" rel="nofollow">Debugging JS on Hermes using Google Chrome\'s DevTools
缁煎悎鏉ョ湅锛孒ermes 鏄竴娆句笓涓虹Щ鍔ㄧ Hybrid UI System 鎵撻€犵殑 JS 寮曟搸锛屽鏋滆鑷缓涓€濂?Hybrid 绯荤粺锛孒ermes 鏄竴涓潪甯稿ソ鐨勯€夋嫨銆?/strong>
4.QuickJS
姝e紡浠嬬粛 QuickJS 鍓嶆垜浠厛璇磋瀹冪殑浣滆€咃細Fabrice Bellard銆?/p>
杞欢鐣屼竴鐩存湁涓娉曪紝涓€涓珮绾х▼搴忓憳鍒涢€犵殑浠峰€煎彲浠ヨ秴杩?20 涓钩搴哥殑绋嬪簭鍛橈紝浣?Fabrice Bellard 涓嶆槸楂樼骇绋嬪簭鍛橈紝浠栨槸澶╂墠锛屽湪鎴戠湅鏉ヤ粬鐨勫垱閫犲姏鍙互瓒呰繃 20 涓珮绾х▼搴忓憳锛屾垜浠彲浠ラ『鐫€鏃堕棿杞?/a>鐞嗕竴涓嬩粬鍒涢€犺繃浜涗粈涔堬細
- 1997骞达紝鍙戝竷浜嗘渶蹇€熺殑璁$畻鍦嗗懆鐜囩殑绠楁硶锛屾绠楁硶鏄?Bailey-Borwein-Plouffe 鍏紡鐨勫彉浣擄紝鍓嶈€呯殑鏃堕棿澶嶆潅搴︽槸O(n^3)锛屼粬缁欎紭鍖栨垚浜哋(n^2)锛屼娇寰楄绠楅€熷害鎻愰珮浜?3%锛岃繖鏄粬鍦?strong>鏁板涓婄殑鎴愬氨
- 2000 骞达紝鍙戝竷浜?FFmpeg锛岃繖鏄粬鍦?strong>闊宠棰戦鍩?/strong>鐨勪竴涓垚灏?/li>
- 2000锛?001锛?018 涓夊勾涓夊害鑾峰緱鍥介檯娣锋穯 C 浠g爜澶ц禌
- 2002 骞达紝鍙戝竷浜員inyGL锛岃繖鏄粬鍦?strong>鍥惧舰瀛﹂鍩?/strong>鐨勬垚灏?/li>
- 2005 骞达紝鍙戝竷浜?QEMU锛岃繖鏄粬鍦?strong>铏氭嫙鍖栭鍩?/strong>鐨勬垚灏?/li>
- 2011 骞达紝浠栫敤 JavaScript 鍐欎簡涓€涓?PC 铏氭嫙鏈?Jslinux锛屼竴涓窇鍦ㄦ祻瑙堝櫒涓婄殑 Linux 鎿嶄綔绯荤粺
- 2019 骞达紝鍙戝竷浜?QuickJS锛屼竴涓敮鎸?ES2020 瑙勮寖鐨?JS 铏氭嫙鏈?/strong>
褰撲汉鍜屼汉涔嬮棿鐨勫樊璺濆樊浜?strong>鍑犱釜鏁伴噺绾?/strong>鍚庯紝缇℃厱瀚夊涔嬬被鐨勬儏缁氨浼氳浆鍙樹负宕囨嫓浜嗭紝Bellard 灏辨槸涓€涓繖鏍风殑浜恒€?/p>
鏀跺涓€涓嬪績鎯咃紝鎴戜滑鏉ョ湅涓€涓?QuickJS 杩欎釜椤圭洰銆俀uickJS 缁ф壙浜?Fabrice Bellard 浣滃搧鐨勪竴璐壒鑹测€斺€?strong>灏忓阀鑰屽張寮哄ぇ銆?/p>
QuickJS 浣撶Н闈炲父灏?/strong>锛屽彧鏈夊嚑涓?C 鏂囦欢锛屾病鏈変贡涓冨叓绯熺殑绗笁鏂逛緷璧栥€備絾鏄粬鐨勫姛鑳藉張闈炲父瀹屽杽锛?strong>JS 璇硶鏀寔鍒?ES2020锛?a href="https://link.segmentfault.com/?url=https%3A%2F%2Ftest262.report%2Fbrowse%2F%3Fdate%3D2020-12-16" rel="nofollow">Test262 鐨勬祴璇曟樉绀猴紝QuickJS 鐨勮娉曟敮鎸佸害姣?V8 杩樿楂樸€?/p>
閭d箞 QuickJS 鐨?strong>鎬ц兘濡備綍鍛紵QuickJS 瀹樹笂鏈変釜鍩哄噯娴嬭瘯锛岀患鍚堟瘮杈冧簡澶氭 JS 寮曟搸瀵瑰悓涓€娴嬭瘯鐢ㄤ緥鐨勮窇鍒嗘儏鍐点€備笅闈㈡槸娴嬭瘯缁撴灉锛?/p>
缁撳悎涓婇潰鐨勮〃鏍煎拰涓汉鐨勪竴浜涙祴璇曪紝鍙互绠€鍗曠殑寰楀嚭涓€浜涚粨璁猴細
- 寮€鍚?JIT 鐨?V8 缁煎悎璇勫垎宸笉澶氭槸 QuickJS 鐨?35 鍊嶏紝浣嗘槸鍦ㄥ悓绛変富鎵?strong>杞婚噺鐨?JS 寮曟搸涓紝QuickJS 鐨?strong>鎬ц兘杩樻槸寰堣€€鐪肩殑
- 鍦ㄥ唴瀛樺崰鐢ㄤ笂锛孮uickJS 杩滀綆浜?V8锛屾瘯绔?JIT 鏄槸鍚冨唴瀛樼殑澶ф埛锛岃€屼笖 QuickJS 鐨勮璁″宓屽叆寮忕郴缁熷緢鍙嬪ソ锛圔ellard 鎴愬氨濂栨澂 馃弳 鍐?+1锛?/li>
- QuickJS 鍜?Hermes 鐨勮窇鍒嗘儏鍐垫槸宸笉澶氱殑锛屾垜绉佷笅鍋氫簡涓€浜涙€ц兘娴嬭瘯锛岃繖涓や釜寮曟搸鐨勮〃鐜颁篃寰堢浉杩?/li>
鍥犱负 QuickJS 鐨勮璁★紝鎴戜笉缁忓ソ濂囦粬鍜?Lua 鐨勬€ц兘瀵规瘮濡備綍銆侺ua 鏄竴闂ㄩ潪甯稿皬宸х簿鎮嶇殑璇█锛屽湪娓告垙棰嗗煙鍜?C/C++ 寮€鍙戜腑涓€鐩村厖褰撹兌姘磋瑷€鐨勪綔鐢紝鎴戜釜浜哄啓浜嗕竴浜涙祴璇曠敤渚嬶紝鍙戠幇 QuickJS 鍜?Lua 鐨勬墽琛屾晥鐜囦篃鏄樊涓嶅鐨勶紝鍚庢潵鍦ㄧ綉涓婃壘鍒颁竴绡囧崥鏂?Lua vs QuickJS锛岃繖涓€佸摜涔熷仛浜嗕竴浜涙祴璇曪紝缁撹涔熸槸瀹冧咯鐨勬€ц兘宸笉澶氾紝鍦ㄩ儴鍒嗗満鏅?Lua 浼氭瘮 QuickJS 蹇竴浜涖€?/p>
瀹樻柟鏂囨。閲屾湁鎻愬埌锛孮uickJS 鏀寔鐢熸垚瀛楄妭鐮?/a>锛岃繖鏍峰彲浠ュ厤鍘?JS 鏂囦欢缂栬瘧瑙f瀽鐨勮繃绋嬨€傛垜涓€寮€濮嬩互涓?QuickJS 鍜?Hermes 涓€鏍凤紝鍙互鐩存帴鐢熸垚瀛楄妭鐮侊紝鐒跺悗浜ょ粰 QuickJS 瑙i噴鎵ц銆傚悗鏉ヨ嚜宸辩紪璇戜簡涓€涓嬫墠鍙戠幇锛孮uickJS 鐨勪綔鐢ㄦ満鍒跺拰 Hermes 杩樹笉澶竴鏍凤細
qjsc
鐢熸垚瀛楄妭鐮佺殑-e
鍜?-c
閫夐」锛岄兘鏄厛鎶?js 鏂囦欢鐢熸垚涓€浠藉瓧鑺傜爜锛岀劧鍚庢嫾鍒颁竴涓?.c
鏂囦欢閲岋紝澶ф闀夸笅闈㈢殑杩欎釜鏍峰瓙锛?/p>#include <quickjs/quickjs-libc.h> const uint32_t qjsc_hello_size = 87; // JS 鏂囦欢缂栬瘧鐢熸垚鐨勫瓧鑺傜爜閮藉湪杩欎釜鏁扮粍閲?const uint8_t qjsc_hello[87] = { 0x02, 0x04, 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x06, 0x6c, 0x6f, 0x67, 0x16, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x22, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2e, 0x6a, 0x73, 0x0e, 0x00, 0x06, 0x00, 0x9e, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x14, 0x01, 0xa0, 0x01, 0x00, 0x00, 0x00, 0x39, 0xf1, 0x00, 0x00, 0x00, 0x43, 0xf2, 0x00, 0x00, 0x00, 0x04, 0xf3, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0xd1, 0x28, 0xe8, 0x03, 0x01, 0x00, }; int main(int argc, char **argv) { JSRuntime *rt; JSContext *ctx; rt = JS_NewRuntime(); ctx = JS_NewContextRaw(rt); JS_AddIntrinsicBaseObjects(ctx); js_std_add_helpers(ctx, argc, argv); js_std_eval_binary(ctx, qjsc_hello, qjsc_hello_size, 0); js_std_loop(ctx); JS_FreeContext(ctx); JS_FreeRuntime(rt); return 0; }
鍥犱负杩欐槸涓?
.c
鏂囦欢锛屾兂璺戣捣鏉ヨ繕寰?strong>鍐?/strong>缂栬瘧涓€娆$敓鎴愪簩杩涘埗鏂囦欢銆?/p>浠庡瓧鑺傜爜杩欎釜璁捐鐐规潵鐪嬶紝QuickJS 鍜?Hermes 鐨勫畾浣嶈繕鏄笉澶竴鏍风殑銆傝櫧鐒剁洿鎺ョ敓鎴愬瓧鑺傜爜鍙互澶уぇ鍑忓皯 JS 鏂囨湰鏂囦欢鐨勮В鏋愭椂闂达紝浣嗘槸 QuickJS 杩樻槸鏇村亸宓屽叆寮忎竴浜涳紝鐢熸垚鐨勫瓧鑺傜爜鏀惧湪涓€涓?C 鏂囦欢涓紝杩橀渶瑕佽繘琛岀紪璇戞墠鑳借繍琛岋紱Hermes 涓?React Native 鑰岀敓锛岀敓鎴愮殑瀛楄妭鐮佷竴寮€濮嬪氨鑰冭檻鍒板垎鍙戝姛鑳斤紙鐑洿鏂板氨鏄竴涓簲鐢ㄥ満鏅級锛屾敮鎸佸瓧鑺傜爜鐨勭洿鎺ュ姞杞借繍琛岋紝涓嶉渶瑕佸啀缂栬瘧涓€娆°€?/p>
涓婇潰涓昏杩樻槸瀵规€ц兘鐨勮€冮噺锛屼笅闈㈡垜浠湅鐪嬪紑鍙戜綋楠岋紝棣栧厛鏄?QuickJS 鐨?code>璋冭瘯鍔熻兘鏀寔銆傚埌鐩墠涓烘锛?021-02-22锛夛紝QuickJS 杩樻病鏈夊畼鏂圭殑璋冭瘯鍣紝涔熷氨鏄
debugger
璇彞浼氳蹇界暐锛岀ぞ鍖烘湁浜哄疄鐜颁簡涓€濂楀熀浜?VSCode 鐨勮皟璇曞櫒鏀寔 vscode-quickjs-debug锛屼絾鏄細瀵?QuickJS 鍋氫竴浜涘畾鍒讹紝涓汉杩樻槸铔湡寰呭畼鏂规敮鎸佹煇涓皟璇曞櫒鍗忚鐨勩€?/p>浠?
闆嗘垚
鐨勮搴︿笂鐪嬶紝绀惧尯涓婂凡缁忔湁浜?iOS 鍜?Android 鐨勭ず渚嬮」鐩紝鍙互鎷挎潵鐢ㄦ潵鍙傝€冩帴鍏ュ埌鑷繁鐨勫伐绋嬩腑銆?/p>
缁煎悎鏉ョ湅锛孮uickJS 鏄竴娆炬綔鍔涢潪甯稿ぇ鐨?JS 寮曟搸锛屽湪 JS 璇硶楂樺害鏀寔鐨勫墠鎻愪笅锛岃繕鎶婃€ц兘鍜屼綋绉兘浼樺寲鍒颁簡鏋佽嚧銆傚湪绉诲姩绔殑 Hybrid UI 鏋舵瀯鍜屾父鎴忚剼鏈郴缁熼兘鍙互鑰冭檻鎺ュ叆銆?/strong>
閫夊瀷鎬濊矾
1.鍗曞紩鎿?/h3>
鍗曞紩鎿庣殑鎰忔€濆氨鏄?iOS 绔拰 Android 绔粺涓€閲囩敤涓€涓紩鎿庯紝杩欐牱鍋氱殑璇濆湪 JS 灞傚樊寮傚彲浠ユ姽骞筹紝涓嶅鏄撳嚭鐜板悓涓€浠?JS 浠g爜鍦?iOS 涓婅繍琛屾槸濂界殑锛孉ndroid 涓婂氨鍑洪敊鐨勫寮?BUG銆傜粨鍚堝競闈笂鐨勮法绔柟妗堬紝澶ф鏈変笅闈笁绉嶉€夊瀷锛?/p>
- 缁熶竴閲囩敤 JSC锛氳繖涓槸 React Native 0.60 涔嬪墠鐨勬柟妗?/li>
- 缁熶竴浣跨敤 Hermes锛氳繖涓槸 React Native 0.64 涔嬪悗鐨勮璁℃柟妗?/li>
- 缁熶竴閲囩敤 QuickJS锛歈uickJS 浣撶Н寰堝皬锛屽彲浠ョ敤鏉ュ埗浣滈潪甯歌交閲忕殑 Hybrid 绯荤粺
涓婇潰鐪嬪嚭娌℃湁缁熶竴閲囩敤 V8锛岃繖涓氨鏄垜鍓嶉潰璇寸殑锛孷8 鍦?iOS 骞冲彴娌℃湁涓诲満浼樺娍锛屽叧闂?JIT 鍚庢€ц兘鍜?JSC 宸笉澶氾紝杩樹細澧炲ぇ鍖呬綋绉紝骞朵笉鏄緢鍒掔畻銆?/p>
2.鍙屽紩鎿?/h3>
鍙屽紩鎿庝篃寰堝ソ鐞嗚В锛屽氨鏄?iOS 绔拰 Android 绔悇鐢ㄥ悇鐨勶紝浼樼偣鏄彲浠ュ彂鎸ュ悇鑷殑涓诲満浼樺娍锛岀己鐐规槸鍙兘浼氬洜涓哄钩鍙颁笉涓€鑷村鑷村弻绔繍琛岀粨鏋滀笉缁熶竴锛岀幇鍦ㄧ殑鏂规鏈夎繖涔堝嚑绉嶏細
- iOS 鐢?JSC锛孉ndroid 鐢?V8锛歐eex锛孨ativeScript 閮芥槸杩欐牱鐨勶紝鍙互鍦ㄥ寘浣撶Н鍜屾€ц兘涓婃湁杈冨ソ鐨勫潎琛?/li>
- iOS 鐢?JSC锛孉ndroid 鐢?Hermes锛歊eact Natvie 鐜板浠婄殑鏂规
- iOS 鐢?JSC锛孉ndroid 鐢?QuickJS锛氭淮婊寸殑璺ㄧ妗嗘灦 hummer 灏辨槸杩欐牱鐨勮璁?/li>
浠庨€夊瀷涓婄湅锛宨OS 涓婇兘閫夋嫨浜?JSC锛孉ndroid 鍚勬湁鍚勭殑閫夋嫨锛屽€掓槸鍏呭垎鍙戞尌浜嗕袱涓钩鍙扮殑鐗硅壊 : )
3.璋冭瘯
鏃犺鏄崟寮曟搸杩樻槸鍙屽紩鎿庯紝闆嗘垚鍚庣殑涓氬姟寮€鍙戜綋楠屼篃寰堥噸瑕併€傚浜庤嚜甯?debugger 鍔熻兘鐨勫紩鎿庢潵璇翠竴鍒囬兘涓嶅湪璇濅笅锛屼絾鏄浜庢病鏈夊疄鐜拌皟璇曞崗璁殑寮曟搸鏉ヨ锛岀己灏?debugger 杩樻槸浼氬奖鍝嶄綋楠岀殑銆?/p>
浣嗕笉鏄篃娌℃湁鍔炴硶锛屼竴鑸潵璇存垜浠彲浠ユ洸绾挎晳鍥斤紝绫讳技浜?React Native 鐨?
Remote JS Debugging
鐨勬€濊矾锛屾垜浠彲浠ュ姞涓紑鍏筹紝鎶?JS 浠g爜閫氳繃 websocket 浼犻€佸埌 Chrome 鐨?Web Worker锛岀劧鍚庣敤 Chrome 鐨?V8 杩涜璋冭瘯銆傝繖鏍峰仛鐨勪紭鍔挎槸鍙互璋冩暣涓€浜涗笟鍔′笂鐨?BUG锛屽姡鍔垮氨鏄張浼氬紩鍏ヤ竴涓?JS 寮曟搸锛屼竾涓€閬囧埌涓€浜涘紩鎿庡疄鐜扮殑 BUG锛屽氨寰堥毦 debug 浜嗐€備笉杩囧ソ鍦ㄨ繖绉嶆儏鍐甸潪甯搁潪甯稿皯瑙侊紝鎴戜滑涔熶笉鑳藉洜鍣庡簾椋熷鍚с€?/p>鎬荤粨
鏈枃浠?strong>鎬ц兘銆?strong>浣撶Н銆?strong>璋冭瘯渚挎嵎鎬?/strong>绛夊姛鑳界偣鍑哄彂锛屽垎鏋愪簡 JavaScriptCore锛?strong>V8锛?strong>Hermes 鍜?QuickJS 杩?4 娆?JS 寮曟搸锛屽垎鍒垎鏋愪簡瀹冧滑鐨勭己鐐瑰拰寮辩偣锛屽鏋滃ぇ瀹舵湁绉诲姩绔?JS 寮曟搸閫夊瀷鐨勫洶鎯戯紝鎴戣涓轰粠鏈枃鍑哄彂锛岃繕鏄彲浠ョ粰涓嶅皯浜轰互鐏垫劅鐨勶紝甯屾湜鎴戠殑杩欑瘒鏂囩珷鑳藉府鍔╁埌澶у銆?/p>
鍙傝€冮摼鎺?/h2>
璺ㄧ妗嗘灦鐨勬牳蹇冩妧鏈埌搴曟槸浠€涔堬紵
濡備綍闅愯棌浣犵殑鐑洿鏂?bundle 鏂囦欢锛?/a>
娣卞叆鐞嗚ВJSCore
QuickJS 寮曟搸涓€骞磋闂诲綍
濡傛灉浣犲枩娆㈡垜鐨勬枃绔狅紝甯屾湜鐐硅禐馃憤 鏀惰棌 馃搧 鍦ㄧ湅 馃専 涓夎繛涓€涓嬶紝璋㈣阿浣狅紝杩欏鎴戠湡鐨勫緢閲嶈锛?/blockquote>娆㈣繋澶у鍏虫敞鎴戠殑寰俊鍏紬鍙凤細鍗よ泲瀹為獙瀹?/strong>锛岀洰鍓嶄笓娉ㄥ墠绔妧鏈紝瀵瑰浘褰㈠涔熸湁涓€浜涘井灏忕爺绌躲€?/p>
鍘熸枃閾炬帴 馃憠 馃 绉诲姩绔?JS 寮曟搸鍝寮猴紵缇庡浗纭呰胺鎵?.....锛氭洿鏂版洿鍙婃椂锛岄槄璇讳綋楠屾洿浣?/p>
以上是关于馃 绉诲姩绔?JS 寮曟搸鍝寮猴紵缇庡浗纭呰胺鎵?.....的主要内容,如果未能解决你的问题,请参考以下文章