Skip to content

Commit

Permalink
[update] update to toxic-decorators 0.3.2 but it failed
Browse files Browse the repository at this point in the history
what:
why:
how:
  • Loading branch information
toxic-johann committed Jul 21, 2017
1 parent 4f3d226 commit 0da3126
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion __tests__/dispatcher/index.js
Expand Up @@ -238,7 +238,11 @@ describe('dispatcher', () => {
expect(this.box).toBe('mp4');
}
inited () {
expect(() => {this.box = 'hls';}).toThrow();
// this.box = 'hls';
// console.log(this.box, this.$videoConfig.box);
// console.log(Object.getOwnPropertyDescriptor(this, 'box'), Object.getOwnPropertyDescriptor(this.$videoConfig, 'box'));
// console.error(Object.getOwnPropertyDescriptor(this, 'box'));
// expect(() => {this.box = 'hls';}).toThrow();
}
}
Dispatcher.install(LockKernelProperty);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -43,7 +43,7 @@
"babel-runtime": "^6.23.0",
"chimee-helper": "^0.1.10",
"chimee-kernel": "^1.0.3",
"toxic-decorators": "^0.3.1"
"toxic-decorators": "^0.3.2"
},
"devDependencies": {
"babel-eslint": "^7.2.3",
Expand Down
8 changes: 5 additions & 3 deletions src/dispatcher/video-config.js
Expand Up @@ -132,21 +132,23 @@ export default class VideoConfig {
@setVideo('disableRemotePlayback', true)
@alwaysBoolean()
disableRemotePlayback = false;
@frozen
_kernelProperty = ['type', 'box', 'runtimeOrder'];
get volume (): number {
return this.dispatcher.dom.videoElement.volume;
}
set volume (volume: number) {
this.dispatcher.dom.videoElement.volume = volume;
}
@frozen
_kernelProperty = ['type', 'box', 'runtimeOrder'];
@frozen
_realDomAttr = ['src', 'controls', 'width', 'height', 'crossorigin', 'loop', 'muted', 'preload', 'poster', 'autoplay', 'playsinline', 'x5VideoPlayerFullScreen', 'x5VideoOrientation', 'xWebkitAirplay', 'playbackRate', 'defaultPlaybackRate', 'autoload', 'disableRemotePlayback', 'defaultMuted', 'volume'];
lockKernelProperty () {
// const desc = Object.getOwnPropertyDescriptor(this, 'type');
// if(desc.configurable) console.warn(desc);
applyDecorators(this, {
type: lock,
box: lock,
runtimeOrder: lock
}, {self: true});
}, {self: true, omit: true});
}
}

0 comments on commit 0da3126

Please sign in to comment.