1 | import {
|
2 | has
|
3 | } from 'min-dash';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | var DI_ERROR_MESSAGE = 'Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472';
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export function ensureCompatDiRef(businessObject) {
|
20 |
|
21 |
|
22 | if (!has(businessObject, 'di')) {
|
23 | Object.defineProperty(businessObject, 'di', {
|
24 | enumerable: false,
|
25 | get: function() {
|
26 | throw new Error(DI_ERROR_MESSAGE);
|
27 | }
|
28 | });
|
29 | }
|
30 | } |
\ | No newline at end of file |