| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 const WebServiceWorkerError& webError) { | 130 const WebServiceWorkerError& webError) { |
| 131 ScriptState* scriptState = resolver->getScriptState(); | 131 ScriptState* scriptState = resolver->getScriptState(); |
| 132 switch (webError.errorType) { | 132 switch (webError.errorType) { |
| 133 case WebServiceWorkerError::ErrorTypeNetwork: | 133 case WebServiceWorkerError::ErrorTypeNetwork: |
| 134 case WebServiceWorkerError::ErrorTypeNotFound: | 134 case WebServiceWorkerError::ErrorTypeNotFound: |
| 135 case WebServiceWorkerError::ErrorTypeScriptEvaluateFailed: | 135 case WebServiceWorkerError::ErrorTypeScriptEvaluateFailed: |
| 136 // According to the spec, these errors during update should result in | 136 // According to the spec, these errors during update should result in |
| 137 // a TypeError. | 137 // a TypeError. |
| 138 return V8ThrowException::createTypeError( | 138 return V8ThrowException::createTypeError( |
| 139 scriptState->isolate(), getExceptionParams(webError).message); | 139 scriptState->isolate(), getExceptionParams(webError).message); |
| 140 case WebServiceWorkerError::ErrorTypeType: |
| 141 return V8ThrowException::createTypeError(scriptState->isolate(), |
| 142 webError.message); |
| 140 default: | 143 default: |
| 141 return toV8(ServiceWorkerError::take(resolver, webError), | 144 return toV8(ServiceWorkerError::take(resolver, webError), |
| 142 scriptState->context()->Global(), scriptState->isolate()); | 145 scriptState->context()->Global(), scriptState->isolate()); |
| 143 } | 146 } |
| 144 } | 147 } |
| 145 | 148 |
| 146 } // namespace blink | 149 } // namespace blink |
| OLD | NEW |