[ js ] try catch let的問題

看板Ajax作者 (不能實現的夢)時間17年前 (2008/07/01 21:23), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/2 (看更多)
var actual=''; try { try { throw 1; } catch(e4 if 0) {print("catch e4"); } catch(e5 if (new NaN)) {print("catcah e5"); } } catch(ex) { print("catch ex"); actual = ex + ''; } print(actual); try { z = [1]; let ( x = (undefined ? 3 : z)) { x.t.g } } catch(ex) { actual = ex + ''; } print(actual+" 2"); ------------------------------ 第二次print的結果卻是 e4.t has no property 本來是希望跑出 x.t has no property 想不通為什麼會這樣 變成第一個catch裡面的e4 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.167.17.165 ※ 編輯: rkt 來自: 218.167.17.165 (07/01 22:08)

07/02 01:25, , 1F
你用的直譯器或引擎??我用js1.8跑不出來你的結果
07/02 01:25, 1F

07/02 08:54, , 2F
用js1.8可以跑出 x.t has no property的結果嗎
07/02 08:54, 2F

07/02 08:57, , 3F
我也是用1.8在跑的
07/02 08:57, 3F
文章代碼(AID): #18QY_czY (Ajax)
討論串 (同標題文章)
文章代碼(AID): #18QY_czY (Ajax)