国产chinesehdxxxx野外,国产av无码专区亚洲av琪琪,播放男人添女人下边视频,成人国产精品一区二区免费看,chinese丰满人妻videos

錯誤

2018-02-24 15:11 更新

錯誤,與提示有所不同,將會中斷編譯器的下一步進程。基本上,它們中斷編譯并像堆棧跟蹤一樣在輸出流中顯示相關信息,這對調試很有幫助。因此,如果程序無法繼續(xù)執(zhí)行就應該拋出錯誤。如有可能,嘗試解決這個問題并以顯示提醒的方式代替。

舉個例子,假設你創(chuàng)建了一個 getter 函數來從特定 map 中獲取值。如果想要獲取的值并不在 map 中,就可能會拋出錯誤。

/// Z-indexes map, gathering all Z layers of the application
/// @access private
/// @type Map
/// @prop {String} key - Layer’s name
/// @prop {Number} value - Z value mapped to the key
$z-indexes: (
  'modal': 5000,
  'dropdown': 4000,
  'default': 1,
  'below': -1,
);

/// Get a z-index value from a layer name
/// @access public
/// @param {String} $layer - Layer's name
/// @return {Number}
/// @require $z-indexes
@function z($layer) {
  @if not map-has-key($z-indexes, $layer) {
    @error 'There is no layer named `#{$layer}` in $z-indexes. '
         + 'Layer should be one of #{map-keys($z-indexes)}.';
  }

  @return map-get($z-indexes, $layer);
}
以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號