zoukankan      html  css  js  c++  java
  • WinJS.Namespace Angkor:

    defineWithParent: function defineWithParent(parentNamespace, name, members) { /// /// /// Defines a new namespace with the specified name under the specified parent namespace. /// ////// The parent namespace. /// ////// The name of the new namespace. /// ////// The members of the new namespace. /// /// /// The newly-defined namespace. /// /// var currentNamespace = parentNamespace, namespaceFragments = name.split("."); for (var i = 0, len = namespaceFragments.length; i < len; i++) { var namespaceName = namespaceFragments[i]; if (!currentNamespace[namespaceName]) { Object.defineProperty(currentNamespace, namespaceName, { value: {}, writable: false, enumerable: true, configurable: true } ); } currentNamespace = currentNamespace[namespaceName]; } if (members) { initializeProperties(currentNamespace, members); } return currentNamespace; }


    define: function define(name, members) { /// /// /// Defines a new namespace with the specified name. /// /// /// The name of the namespace. This could be a dot-separated name for nested namespaces. /// /// /// The members of the new namespace. /// /// /// The newly-defined namespace. /// /// return defineWithParent(global, name, members); }


  • 相关阅读:
    生于忧患,死于安乐
    【网络流24题】骑士共存问题
    【网络流24题】最长不下降子序列问题
    【网络流24题】太空计划问题
    SG函数
    【网络流24题】餐巾计划问题
    【APIO2019】奇怪装置
    【HEOI2016/TJOI2016】游戏
    【SDOI2015】星际战争
    【CQOI2009】跳舞
  • 原文地址:https://www.cnblogs.com/wujiakun/p/2839548.html
Copyright © 2011-2022 走看看