mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-09 09:12:06 +08:00
Summary: Instead of using plain objects and having to convert to and from them we just use the `Module` class across the codebase. This seems cleaner and can enforce the type as opposed to fuzzy objects.
39 lines
573 B
JavaScript
39 lines
573 B
JavaScript
'use strict';
|
|
|
|
const Promise = require('promise');
|
|
const Module = require('./Module');
|
|
|
|
class Polyfill extends Module {
|
|
constructor({ path, id, dependencies }) {
|
|
super(path);
|
|
this._id = id;
|
|
this._dependencies = dependencies;
|
|
}
|
|
|
|
isHaste() {
|
|
return Promise.resolve(false);
|
|
}
|
|
|
|
getName() {
|
|
return Promise.resolve(this._id);
|
|
}
|
|
|
|
getPackage() {
|
|
return null;
|
|
}
|
|
|
|
getDependencies() {
|
|
return Promise.resolve(this._dependencies);
|
|
}
|
|
|
|
isJSON() {
|
|
return false;
|
|
}
|
|
|
|
isPolyfill() {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
module.exports = Polyfill;
|