| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 if (value->IsNumber()) { | 39 if (value->IsNumber()) { |
| 40 bool ok = false; | 40 bool ok = false; |
| 41 uint32_t type = toUInt32(value, ok); | 41 uint32_t type = toUInt32(value, ok); |
| 42 if (!ok || !imp->setType(type)) | 42 if (!ok || !imp->setType(type)) |
| 43 throwTypeError("Illegal OscillatorNode type", info.GetIsolate()); | 43 throwTypeError("Illegal OscillatorNode type", info.GetIsolate()); |
| 44 return; | 44 return; |
| 45 } | 45 } |
| 46 | 46 |
| 47 if (value->IsString()) { | 47 if (value->IsString()) { |
| 48 String type = toWebCoreString(value.As<v8::String>()); | 48 String type = toCoreString(value.As<v8::String>()); |
| 49 if (type == "sine" || type == "square" || type == "sawtooth" || type ==
"triangle") { | 49 if (type == "sine" || type == "square" || type == "sawtooth" || type ==
"triangle") { |
| 50 imp->setType(type); | 50 imp->setType(type); |
| 51 return; | 51 return; |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 throwTypeError("Illegal OscillatorNode type", info.GetIsolate()); | 55 throwTypeError("Illegal OscillatorNode type", info.GetIsolate()); |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace WebCore | 58 } // namespace WebCore |
| 59 | 59 |
| 60 #endif // ENABLE(WEB_AUDIO) | 60 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |