diff options
| author | ruki <[email protected]> | 2017-06-29 16:23:23 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-06-29 16:23:23 +0800 |
| commit | 2f22a73afe79ca3f6728b8e639850b04c7880d03 (patch) | |
| tree | 2232cbaaa6bb6016960fd514752939fab4f30757 | |
| parent | dffe2441960d670eb8c7cc2e85a8106feb6ec86b (diff) | |
disable cache for inherit
| -rw-r--r-- | xmake/core/sandbox/modules/import.lua | 2 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/inherit.lua | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/xmake/core/sandbox/modules/import.lua b/xmake/core/sandbox/modules/import.lua index 1d81e68c6..5317efa6e 100644 --- a/xmake/core/sandbox/modules/import.lua +++ b/xmake/core/sandbox/modules/import.lua @@ -329,7 +329,7 @@ function sandbox_import.import(name, args) -- load it from cache first local moduleinfo = modules[modulekey] - if moduleinfo and not args.nocache then + if moduleinfo and not args.nocache and not args.inherit then module = moduleinfo[1] errors = moduleinfo[2] else diff --git a/xmake/core/sandbox/modules/inherit.lua b/xmake/core/sandbox/modules/inherit.lua index cf22abcec..2ec1e2e29 100644 --- a/xmake/core/sandbox/modules/inherit.lua +++ b/xmake/core/sandbox/modules/inherit.lua @@ -30,10 +30,16 @@ local import = require("sandbox/modules/import") -- we can access all super interfaces by _super -- -- @note the polymiorphism is not supported for import.inherit mode now. -function sandbox_inherit(name) +function sandbox_inherit(name, args) + + -- init args + args = args or {} + + -- mark as inherit + args.inherit = true -- import and inherit it - return import(name, {inherit = true}) + return import(name, args) end -- load module |
