(parent *chain, val map[string]interface{})
| 40 | } |
| 41 | |
| 42 | func newObject(parent *chain, val map[string]interface{}) *Object { |
| 43 | o := &Object{chain: parent.clone(), value: nil} |
| 44 | |
| 45 | opChain := o.chain.enter("") |
| 46 | defer opChain.leave() |
| 47 | |
| 48 | if val == nil { |
| 49 | opChain.fail(AssertionFailure{ |
| 50 | Type: AssertNotNil, |
| 51 | Actual: &AssertionValue{val}, |
| 52 | Errors: []error{ |
| 53 | errors.New("expected: non-nil map"), |
| 54 | }, |
| 55 | }) |
| 56 | } else { |
| 57 | o.value, _ = canonMap(opChain, val) |
| 58 | } |
| 59 | |
| 60 | return o |
| 61 | } |
| 62 | |
| 63 | // Raw returns underlying value attached to Object. |
| 64 | // This is the value originally passed to NewObject, converted to canonical form. |
searching dependent graphs…