Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Sign In

uber / deck.gl / 13779

18 Sep 2019 - 0:00 coverage decreased (-2.9%) to 79.902%
13779

Pull #3623

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
beta.2
Pull Request #3623: Bump dependency versions

3405 of 4619 branches covered (73.72%)

Branch coverage included in aggregate %.

7031 of 8442 relevant lines covered (83.29%)

5687.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.29
/modules/core/src/lifecycle/component.js
1
import {LIFECYCLE} from '../lifecycle/constants';
13×
2
import {createProps} from '../lifecycle/create-props';
3
// import {diffProps} from '../lifecycle/props';
4
// import log from '../utils/log';
5
// import assert from '../utils/assert';
6

7
import ComponentState from './component-state';
8

9
const defaultProps = {};
1×
10

11
let counter = 0;
1×
12

13
export default class Component {
14
  constructor(/* ...propObjects */) {
15
    // Merge supplied props with default props and freeze them.
16
    /* eslint-disable prefer-spread */
17
    this.props = createProps.apply(this, arguments);
1,329×
18
    /* eslint-enable prefer-spread */
19

20
    // Define all members before layer is sealed
21
    this.id = this.props.id; // The layer's id, used for matching with layers from last render cycle
1,329×
22
    this.count = counter++; // Keep track of how many layer instances you are generating
1,329×
23
    this.lifecycle = LIFECYCLE.NO_STATE; // Helps track and debug the life cycle of the layers
1,329×
24
    this.parent = null; // reference to the composite layer parent that rendered this layer
1,329×
25
    this.context = null; // Will reference layer manager's context, contains state shared by layers
1,329×
26
    this.state = null; // Will be set to the shared layer state object during layer matching
1,329×
27
    this.internalState = null;
1,329×
28

29
    // Seal the layer
30
    Object.seal(this);
1,329×
31
  }
32

33
  // clone this layer with modified props
34
  clone(newProps) {
35
    const {props} = this;
320×
36

37
    // Async props cannot be copied with Object.assign, copy them separately
38
    const asyncProps = {};
320×
39

40
    // See async props definition in create-props.js
41
    for (const key in props._asyncPropDefaultValues) {
320×
42
      if (key in props._asyncPropResolvedValues) {
355×
43
        asyncProps[key] = props._asyncPropResolvedValues[key];
319×
44
      } else if (key in props._asyncPropOriginalValues) {
Branches [[1, 0]] missed. 36×
UNCOV
45
        asyncProps[key] = props._asyncPropOriginalValues[key];
!
46
      }
47
    }
48

49
    // Some custom layer implementation may not support multiple arguments in the constructor
50
    return new this.constructor(Object.assign({}, props, asyncProps, newProps));
320×
51
  }
52

53
  get stats() {
UNCOV
54
    return this.internalState.stats;
!
55
  }
56

57
  // PROTECTED METHODS, override in subclass
58

59
  _initState() {
60
    this.internalState = new ComponentState({});
1×
61
  }
62
}
63

64
Component.componentName = 'Component';
1×
65
Component.defaultProps = defaultProps;
1×
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
BLOG · TWITTER · Legal & Privacy · Supported CI Services · What's a CI service? · Automated Testing

© 2019 Coveralls, LLC